Author |
Message
|
woodoo2k |
Posted: Mon Nov 03, 2008 11:11 am Post subject: How to get QCF/JMS Destination information within MDB |
|
|
 Apprentice
Joined: 07 Feb 2005 Posts: 28 Location: USA
|
Hi,
I need to deploy multiple instances of same MDB to listen to 4 queues.
Could somebody please tell me how to configure the ejb-jar.xml and weblogic-ejb-jar.xml to achieve this?
I am also trying to retrieve the name of the Connection Factory and JMS Destination within each MDB for accounting for information like how many messages are received by the MDB on a particular queue per seccond.
Is there any way to obtain this information in case of an MDB?
I am using MQ as Foreign JMS Provide on Weblogic Application Server v9.2
Any help/pointers are highly appreciates!
Thanks! |
|
Back to top |
|
 |
atheek |
Posted: Mon Nov 03, 2008 12:40 pm Post subject: |
|
|
 Partisan
Joined: 01 Jun 2006 Posts: 327 Location: Sydney
|
Define 4 different mdb's that point to the same class in ejb_jar:
Code: |
eg.
<enterprise-beans>
<message-driven>
<ejb-name>MDB1</ejb-name>
<ejb-class><<Your MDB Class Name>></ejb-class>
...............................
</message-driven>
<message-driven>
<ejb-name>MDB2</ejb-name>
<ejb-class><<Your MDB Class Name>></ejb-class>
...............................
</message-driven>
<message-driven>
<ejb-name>MDB3</ejb-name>
<ejb-class><<Your MDB Class Name>></ejb-class>
...............................
</message-driven>
<message-driven>
<ejb-name>MDB4</ejb-name>
<ejb-class><<Your MDB Class Name>></ejb-class>
...............................
</message-driven>
</enterprise-beans> |
Associate the destinations for each of the mdb's in weblogic-ejb-jar:
Code: |
<weblogic-ejb-jar>
<weblogic-enterprise-bean>
<ejb-name>MDB1</ejb-name
.................................................
<destination-jndi-name>DEST1</destination-jndi-name>
<connection-factory-jndi-name>CF1</connection-factory-jndi-name>
.................................................
</weblogic-enterprise-bean>
<weblogic-enterprise-bean>
<ejb-name>MDB2</ejb-name
.................................................
<destination-jndi-name>DEST2</destination-jndi-name>
<connection-factory-jndi-name>CF2</connection-factory-jndi-name>
.................................................
</weblogic-enterprise-bean>
<weblogic-enterprise-bean>
<ejb-name>MDB3</ejb-name
.................................................
<destination-jndi-name>DEST3</destination-jndi-name>
<connection-factory-jndi-name>CF3</connection-factory-jndi-name>
.................................................
</weblogic-enterprise-bean>
<weblogic-enterprise-bean>
<ejb-name>MDB4</ejb-name
.................................................
<destination-jndi-name>DEST4</destination-jndi-name>
<connection-factory-jndi-name>CF4</connection-factory-jndi-name>
.................................................
</weblogic-enterprise-bean>
</weblogic-ejb-jar>
|
[/quote] |
|
Back to top |
|
 |
woodoo2k |
Posted: Mon Nov 03, 2008 12:49 pm Post subject: |
|
|
 Apprentice
Joined: 07 Feb 2005 Posts: 28 Location: USA
|
Thanks a lot for providing the sample configuration in the reply..
Could you please also point to the way to access the name of QCF and Destination from within MDB code?
This is required in order to update the stats for corresponding queues.
Thanks a lot in advance! |
|
Back to top |
|
 |
fjb_saper |
Posted: Mon Nov 03, 2008 3:16 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20763 Location: LI,NY
|
woodoo2k wrote: |
Thanks a lot for providing the sample configuration in the reply..
Could you please also point to the way to access the name of QCF and Destination from within MDB code?
This is required in order to update the stats for corresponding queues.
Thanks a lot in advance! |
See if you can cast the QCF to an MQQueueConnectionFactory and retrieve the info you need that way.
As for the queue names check the message.getJMSDestination() function.
Enjoy  _________________ MQ & Broker admin |
|
Back to top |
|
 |
|