I'd like to create a setup like in the picture below:
Can this be done with Spring Integration's support for AMQP? I.e. can the communication channels in the picture be AMQP? The goal is so that:
- Each component in the picture can be a separate server.
- I can scale up each consumer group.
- Only one worker from each consumer group processes the message.
- Each consumer group receives each message.
I looked at the documentation, but am not sure if the two AMQP Message Channel implementations that SI provides (point-to-point and publish/subscribe) will do the trick here. In particular, would the point-to-point channel work like a regular Direct Channel, i.e. support multiple endpoints, only one of which receives each message?
Many thanks!
Replace the pub-sub channel with an outbound-channel-adapter that publishes to a
fanout
exchange.Bind 2 queues to the fanout exchange; each will get a copy of the message.
Use inbound-channel-adapters for each of your consumers, each listening to the appropriate queue; the two groups of consumers will compete for their messages.