Closed balmasi closed 7 years ago
You can specify a specific queue for each of the services, and the processes of that service will round robin off the same queue. e.g.
bus.subscribe({ routingKey: "event.user.updated", queueName: "event.user.updated.orderService"}, handleUserUpdated) bus.subscribe({ routingKey: "event.user.updated", queueName: "event.user.updated.analyticService"}, handleUserUpdated)
Yup. That's the way to do it.
Would love help documenting some of this stuff, if anybody wants to help become a maintainer.
I've been struggling to implement this using servicebus.
Example Scenario:
User service: 1 process Order Service: 3 processes Analytics Service: 5 processes
user updates firstname.
I want to publish
'event.user.updated', { user }
to both order service and analytics service.However, only one processes should pick it up and process it PER SERVICE. e.g. 1 process from the 5 analytics processes picks the message up and does something. 1 process from the 3 order processes picks the message up and does something.
Everything I've tried with servicebus leads to roundrobin between the processes of all the services. How can I achieve this?