Skip to content

Conversation

Zerpet
Copy link
Member

@Zerpet Zerpet commented Aug 14, 2025

Sumary

This PR adds high level constructs for RPC communication.

Additional changes

  • Set Go toolchain: helps to keep the required Go version lower, and ensures we build with latest Go to avoid CVEs
  • Bump Ginkgo Gomega and use floating 4.1 image in test
  • Add VS Code gitignores

Pending work

  • Add examples
  • Add an E2E test using both constructs

Zerpet added 11 commits August 6, 2025 13:41
The happy path works. The server can connect to a queue and responds
messages if the request's replyTo property is set.
RPC Tests were refactored to extract common setup code into a before
each node.
A test that verifies that custom correction ID and custom post processor
are called by the server.
The test for RpcServer.Close() was returning too soon. The simplest
solution is an ugly sleep of 1 second.
RPC server construct provides an utility to pause the message
processing. This relies on the ability to "drain" credits, and issue new
credits at a later point to unpause. This commit exposes that
functionality internally.
The RPC server now can be constructred from the AMQP connection. Tests
were refactored to use this contructor, instead of manually setting up
publishers and consumers.
Because setting the reply-to address in the post-processor forces the
users of custom post-processors to remember/add a line to set the
reply-to address always. By setting the reply-to prior to the
post-processor, the user has the option to modify the reply-to before
sending, if desired. By setting the reply-to prior to post-processor, we
free up some cognitive load on the users who wish to use a custom
post-processor.
@Zerpet Zerpet added this to the 0.1.2 milestone Aug 14, 2025
@Zerpet Zerpet linked an issue Aug 14, 2025 that may be closed by this pull request
Zerpet added 3 commits August 18, 2025 10:40
Refactor pointer-to functions: one generic function to rule them all
The automatic reconnection  was racy. It could try to open a connection
at the same time that `Close()` was called on `AmqpConnection`. This
required introducing an internal field to determine when the connection
is "closed", and a specific error to signal in the reconnection that the
connection is "closed" after calling `Close()`.
CorrectionID -> CorrelationID

Sometimes AI doesnt get it right
@Zerpet Zerpet marked this pull request as ready for review August 19, 2025 09:08
@Zerpet
Copy link
Member Author

Zerpet commented Aug 19, 2025

I've doing chaos testing of the RPC constructs, and it doesn't handle at all the connection dropping. Since this PR is already quite large (+1800 lines), I'm inclined to add automatic reconnection in a follow up PR.

Signed-off-by: Gabriele Santomaggio <G.santomaggio@gmail.com>
@Gsantomaggio Gsantomaggio self-assigned this Sep 1, 2025
@Gsantomaggio Gsantomaggio merged commit 6dd64ee into main Sep 1, 2025
2 of 4 checks passed
@Zerpet Zerpet deleted the rpc branch September 23, 2025 09:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement RPC

2 participants