• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Sequenctial processing of requests

 
Ranch Hand
Posts: 114
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Water! People swim in water! Even tiny ads swim in water:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic