-
1. Re: How to invoke an MDB
jaikiran Sep 20, 2005 3:20 AM (in response to raja5000)When you say you have packaged your MDB in your ear, i assume that you mentioned the necessary details about your MDB in the deployment descriptors as well. One of them being the jndi name of the queue on which this MDB will be listening. So, once the message is there in that particular queue, the onMessage(Message m) method of your MDB will be invoked. The parameter passed to this method will be the message that was sent to the queue
-
2. Re: How to invoke an MDB
raja5000 Sep 20, 2005 3:33 AM (in response to raja5000)Hi Jai,
do u mean to say me that I need to specify my mdb module in application.xml of the ear file.. if so, is that to be done in the same manner as like that of mentioning my session bean details in the deployment descriptor ..??
Then where shud I specify the jndi name of the queue.. shud i specify on the application.xml itself.. can u send me a sample deployment descriptor application.xml which has the details abt an MDB
Thanks in advance
Raja -
3. Re: How to invoke an MDB
jaikiran Sep 20, 2005 3:40 AM (in response to raja5000)You will be making entries for the MDB in ejb-jar.xml and jboss.xml
In your ejb-jar.xml you will have something like the following:<!-- Message Driven Beans --> <message-driven > <description><![CDATA[<!-- begin-xdoclet-definition -->]]></description> <ejb-name>MyMDBean</ejb-name> <ejb-class>com.abc.MyMDBean</ejb-class> <transaction-type>Bean</transaction-type> <message-driven-destination> <destination-type>javax.jms.Queue</destination-type> </message-driven-destination> </message-driven>
In jboss.xml:<message-driven> <ejb-name>MyMDBean</ejb-name> <destination-jndi-name>queue/YourQueueName</destination-jndi-name> </message-driven>
You have thus configured MyMDBean to listen to queue/YourQueueName queue. Thus whenever a message arrives on the queue/YourQueueName queue, the onMessage method of com.abc.MyMDBean gets called