0
votes

I have one doubt during my work with JMS. As I know it's possible to create synchrous message consumer. However, I must launch it with a frequency, because of the fact that there is no listener. Next, to consume messages synchrously from a queue I can create a MDB and set the pool to 1. I think it is not a good solution.

My aim is to consume messages synchrously when they appear on the queue. From my point of view above mentioned solutions are not good: 1. Consumer which is launched from time to time. 2. MDB (asynchrous normally) and pool is set to 1.

Are there any solutions for my purpose?

1
Additionally, what about situation when there are few MDBs on one queue with different selectors? Will each MDB receive messages synchrously in sending (sequential) order? - KitKatBoy

1 Answers

0
votes

Not sure why you don't like MDBs... but if you want to avoid them, you could use the Spring JMS listener:

http://docs.spring.io/spring-framework/docs/current/spring-framework-reference/html/jms.html