• 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

Concurrency in Message Driven Beans

 
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I have a doubt about how the container process messages simultaneously. Have may differents threads running the same Message Driven Bean Instance ?

For example, if my continer only have a pool of one Message Driven Bean instances, and I have three different clients that send three messages to the same destination, the messages are processed concurrently in the only one intance or the container get the first message, process it, after get the the second process it ... only one thread running per instance.

Thanks.
 
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is just a guess...as I'm not an expert, but
reading the Message Bean life Cycle, i would guess the following:

The EJB container starts MDBs instances and put them in a Pool. If in the pool there are multiple MDBs they can run
at the same time since as I understood it, each instance has its own thread.

If, as you specified, the pool only contains one Bean, I would expect the container to automatically initialize a new
bean and increase the pool.

If on the other hand, as in your case, all beans in the pool are busy (or only one bean is in the pool and the pool size is fixed),
i would expect that a new message is only processed when the MDB is finished with the previous one...

Dave
 
Yeray Santana Borges
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Davide for your clarification. I am now more confortable wiht the MDB life cycle
reply
    Bookmark Topic Watch Topic
  • New Topic