This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Sequenctial processing of requests

 
Michal Glowacki
Ranch Hand
Posts: 114
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,

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) ?

Regards,
Michal
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic