Closed canepat closed 7 years ago
For the request traffic to the same channel and stream id, the Header.sessionId() can be used to match request sources with responses previously matched up with the onAvailableImage() callbacks.
The addService and addGateway APIs in Helios class shall be modified to take as parameter just the input stream where the Aeron subscription takes place; the output streams shall be added to the Service or Gateway using the Aeron onAvailableImage() callback. The Service and Gateway implementations shall be modified to create output ring buffers and their processors accordingly, based on Image callback information (sourceIdentity, streamId, sessionId...).
In order to have separate traffic back to Gateways then the Service needs separate endpoints for them. This can be done in different ways including configuration, a discovery service, or by using the Image.sourceIdentity() which can be picked up when a onAvailableImage() callback is triggered.