Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Message driven bean instance pool and concurrent proceesing  RSS feed

 
kavithakaran kanapathippillai
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • 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

 
Deepak Pant
Ranch Hand
Posts: 446
  • Mark post as helpful
  • send pies
  • 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
  • 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?
 
Pallav Bora
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • 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.
 
ramprasad madathil
Ranch Hand
Posts: 489
Eclipse IDE Java Tomcat Server
  • Mark post as helpful
  • send pies
  • 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
  • Quote
  • Report post to moderator
Thanks Ram. Your answer is really helpful.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!