• 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
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

Message driven bean instance pool and concurrent proceesing

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am new to JMS. Can someone help me understand the following:

I read JMS provider guarantees that message will be serialised to a consumer.
So messages are going to be delivered to the consumer one by one.
Then what is the point of having several instances of MDBs in a pool when the messages are delivered one bye one by the JMS provider?

Or is there a way for the consumer to concurrently process the messages?


Thanks in advance

 
Ranch Hand
Posts: 446
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you configure > 1 MDBs in the message pool to consume the messages then YES they will be processed concurrently. I have tested this in both WebLogic and WebSphere. This # of MDB option can be specified in deployment descriptor (WebLogic) OR in admin console (WebSphere).
 
kavithakaran kanapathippillai
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks.

calling message.acknowledge() on a message acknowledges all previously received but unacknowledged messages.

Now Assume I have 2 instance of an MDB.
Instance 1 has received message1 and it is processing the first message.
Instance 2 has received message2 and has quickly processed message2 before Instance1 and calls message.acknowledge()on message 2. According to JMS contract, JMS provider consider it as an acknowledgement for message1 too
But Instance 1 hasn't finished processing message1 and throws an runtime exception.

Have we lost message 1 permanently? does that mean we can't use client acknowledge with MDB?
 
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
When a message is acknowledge then only that message message gets acknowledged irrespective of whether or not there were anymessage before it. Acknowledging one message can acknowledge other messages on when the messages belong to a message group.
 
Ranch Hand
Posts: 489
Eclipse IDE Tomcat Server Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

calling message.acknowledge() on a message acknowledges all previously received but unacknowledged messages.

Now Assume I have 2 instance of an MDB.



MDBs cannot use the jms api to acknowledge messages. In short, MDBs cannot use message.acknowledge()

cheers,
ram.
 
kavithakaran kanapathippillai
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Ram. Your answer is really helpful.
 
Do you want ants? Because that's how you get ants. And a tiny ads:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic