-
Notifications
You must be signed in to change notification settings - Fork 912
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Client/server architecture #652
Comments
You have the basics down. But one slight addition is needed. If you look at both the Archive and Cluster, the clients have a control session Id that they manage. It can be sent back in the "connect" message. And each response (from server back to client) and subsequent requests (from client to server after the connect) can use it for filtering. This is important for IPC in that you can simply ignore any messages that don't include the clients expected control session Id. But it also serves as a means for the server to know which client is sending a request. |
Ah I see, thanks. Using the comment here as a breadcrumb, it looks like the archiver might use a session ID as a control ID. In which case I think I can do the same, i.e. use the Would you be interested in a PR to add basic RPC as a sample? I can't guarantee I'll find time to put one together but I would have found one useful when starting out. |
That is the control session Id.... not the Publication session Id. Yes, somewhat confusing. Naming is tough. But, those are two different Ids. The control session Id is Archive specific and assigned when an archive client connects. The Publication session Id is assigned by the media driver for the Publication specifically. While you could use that session Id, I would suggest instead grabbing a new Id via In terms of a PR, we do have some examples in the archive and cluster. However, a generalized and concise mechanism that others could use and integrate or could use as an example would be pretty useful, yes. :) |
Hmm but we can't just rely on the server to generate the unique ID because the purpose of the ID is to allow the Looking more closely at the
|
Yes. Pretty much spot on. The cluster and archive use a correlationId on each request/response. So, matching things up is easy. This allows each individual response to be matched with its request. Including the connect. In addition, most of the requests need to have a corresponding response. So, the correlationId does duty on that aspect also. If you notice how the |
Hi there,
Apologies if the answer to this is out there already. I can see several related issues but I've read them over and am still not sure how to handle this.
I'd like to create a regular client<->server setup with Aeron. Clients should be able to send to/receive from the server, not be aware of each other, and this should work over both UDP and IPC.
I'm struggling to figure out exactly how to manage subscriptions and publications to make this happen. What I have now is akin to (for IPC, but could tweak the channel URIs for UDP):
Server
Client
However, I have two clients running on the same machine, both using IPC, and they see each other's messages because they're using the same stream ID.
My best guess of a solution is for each client to somehow ask Aeron for a "free" stream ID, so they can listen without interference. Is that sensible and something which Aeron supports, or if not could you suggest an alternative?
Thanks in advance - I've spent some time understanding Aeron over the past couple of weeks and it looks like a absolutely fantastic piece of software. Excited to get this ironed out and start using it in anger!
The text was updated successfully, but these errors were encountered: