0

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?

Gord Thompson
  • 116,920
  • 32
  • 215
  • 418
KitKatBoy
  • 1
  • 2
  • 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 Jul 15 '14 at 13:57

1 Answers1

0

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

stefan.m
  • 1,912
  • 4
  • 20
  • 36