Meaningless Drivel is fun!
The moose likes EJB and other Java EE Technologies and the fly likes Sequenctial processing of requests Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Sequenctial processing of requests" Watch "Sequenctial processing of requests" New topic

Sequenctial processing of requests

Michal Glowacki
Ranch Hand

Joined: Mar 14, 2006
Posts: 114

I haven't not get help in this thread, but one user asked why I use LinkedList in Message Driven Bean, I thought this could be the error. So now I would like to form question another way:

how to make sure, in Java EE environment (JBoss), that multiple request that come to specific address (I tried MDB), will be processed one by one, not all at the same time?

If I create MessageDrivenBean singleton, should it be enough? All incoming requests will wait in JMS Queue until processing is over (FIFO like) ?

Paul Sturrock

Joined: Apr 14, 2004
Posts: 10336

You would need to use a single instance of a message driven bean, so yes a Singleton MDB. You can usually control the number of instances via your server, though the need to use a single instance usually indicates an MDB is perhaps not the right choice.

You could with change the logic of your application so ordering is less important, or use an old-fashioned MessageListener (i.e. not an EJB) which will guarantee sequential processing of messages at the expense of scalability. You could also look at more sophisticated JMS implementations (such as ActiveMQ) which could give you more control or grouping and ordering messages.

JavaRanch FAQ HowToAskQuestionsOnJavaRanch
I agree. Here's the link:
subject: Sequenctial processing of requests
It's not a secret anymore!