how to force instantiation of MDBs when JBoss starts up?
Csk Kumar
Greenhorn
Joined: Mar 07, 2011
Posts: 13
posted
0
Hi,
I am implementing an event handler using MDB and i am using jboss-5.1.0.GA. In my case, whenever jboss starts up my MDB (constructor should be called) should get instantiated , so that whenever message comes to the queue my onMessage() method will be invoked for message processing. In my MDB constructor i am doining instantiation of other required classes for message processing.
Issue: But now the issue is my MDB constructor is getting called only after the message comes to the queue, becuase of this my message processing(onMessage call) is getting delayed.
Could you please tell me how to instantiate pool of MDB's when JBoss starts up?
Thanks in advance!!
My MDB code looks like this:
EventHandlerMDB.java
Queue configuration in Jboss looks like this:destinations-service.xml
There is no configuration option to do this, so the typical way is to create a startup service and have it feed some dummy messages to the queue. This might help you get started:
http://community.jboss.org/wiki/ExampleHelloWorldService
Hi,
Thanks for the reply. It was really hepfull.
As you said now I am sending dummy messages to the queue during jboss startup and it is working fine .
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.
subject: how to force instantiation of MDBs when JBoss starts up?