ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » IBM MQ Java / JMS » How to get QCF/JMS Destination information within MDB

Post new topic  Reply to topic
 How to get QCF/JMS Destination information within MDB « View previous topic :: View next topic » 
Author Message
woodoo2k
PostPosted: Mon Nov 03, 2008 11:11 am    Post subject: How to get QCF/JMS Destination information within MDB Reply with quote

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
View user's profile Send private message Yahoo Messenger
atheek
PostPosted: Mon Nov 03, 2008 12:40 pm    Post subject: Reply with quote

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
View user's profile Send private message
woodoo2k
PostPosted: Mon Nov 03, 2008 12:49 pm    Post subject: Reply with quote

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
View user's profile Send private message Yahoo Messenger
fjb_saper
PostPosted: Mon Nov 03, 2008 3:16 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
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
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ Java / JMS » How to get QCF/JMS Destination information within MDB
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.