Increasing MDB'S instances
I am using jboss 5.1.x I am trying to increase my mdb's instances. but no success.
some code:
@MessageDriven(activationConfig =
{ @ActivationConfigProperty(prope开发者_如何学CrtyName = "destinationType", propertyValue =
"javax.jms.Queue"),
@ActivationConfigProperty(propertyName = "destination", propertyValue =
Constants.QUEUE_LOOKUP),
@ActivationConfigProperty(propertyName = "maxSession", propertyValue = "50")
}
)
public class ECMSDispatcherMdb implements MessageListener
{
...
}
now when I look at the Console Admin, under the Queues\MyQueue tree:
Consumer Count 1 The number of consumers on the queue
Message Count 0 The number of messages in the queue
- the Consumer Count, keep being only 1.
any idea what is wrong? or what haven't I configured right?
thanks,
ray.
Nothing wrong. Everything is fine. You do not need more than one instance of your MDB when they have nothing to do (0 messages in queue).
If you wish to see several instances I believe you have to perform some kind of load test to force server to create additional instances. Or you can do it easier. Add Thread.sleep(60000) to your MDB. Now push 2 messages to your queue.
In this case the processing of each message will take 1 min, so I guess server will have to process them simultaneously that probably will force it to create additional instance.
MDBs are processed by making one instance and invoking its onMessage(..)
method. So why do you need more instances?
精彩评论