I am using multiple <si:service-activator>
's and <jms:message-driven-channel-adapter>
's to subscribe to multiple queues and topics. Messages from each destination are received in a separate thread, which means that my receiving code is full of locks to guard the mutable internal state.
I would like my receiving code to be lock free. Is it possible to configure spring-integration/activemq to receive from multiple destinations on the same thread?
If this is not possible, I can think of two alternatives:
Start my own processing thread which reads from a blocking queue, put all received messages on this queue.
Dispatch all received messages onto a single destination and consume from this.
Anyone have any better ideas?