WIP
Each service connecting to rabbitmq will need to pass a service-name
that is used to identify the publisher and
consumer towards rabbitmq entities.
If multiple connections with the same name is used (for example when scaling to multiple replicas) all connections will
consume from the same queues
(i.e. Competing consumers).
The naming pattern for exchanges are: <name>.<type>.exchange
, where name usually is the service-name
.
The default event stream is named events.topic.exchange
, which is an exception the pattern above.
A service that is listening for incoming request (and send replies), request-response pattern will create two exchanges. One to allow client to send a request, and one to send replies to.
The request exchange will be named: <service-name>.direct.exchange.request
and the corresponding response exchange: <service-name>.headers.exchange.response
The naming pattern for queues are: <exchange-name>.queue.<service-name>
So for the default event stream events.topic.exchange
the queues will be named:
events.topic.exchange.queue.<service-name>
.
A service that is listening for incoming request will consume messages from a queue:
<exchange-name>.queue
, so it will not contain the service-name twice.
<service-name>.direct.exchange.request.queue
A service that is listening for incoming responses will consume messages from a queue:
<requested-service-name>.headers.exchange.response.queue.<service-name>