canepat / Helios

Helios is a component library for domain-specific scalable applications.
Apache License 2.0
3 stars 1 forks source link

Multiple Gateways cannot be associated correctly to the same Service #9

Closed canepat closed 7 years ago

canepat commented 8 years ago

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.

canepat commented 8 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.

canepat commented 8 years ago

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...).