开发者

How to map a websphere mq 7 queue to a EJB 3 destinationName

I need to map WebSphere MQ7 queue (Say queA in Queue Manager QMA) to a EJB3 MDB.

I created the MQ Queue Manager and Queue using

crtmqm QMA and start it using strmqm MQA

Then i wrote a file file name QMA.conf and included

DEFINE QLOCAL ('queA')

line it and run the command

runmqsc QMA < QMA.conf

then I run

strmqcsv MQA &

runmqlsr -m QMA -t TCP &

All these steps done as mqm logged user.

Then I follow http://community.jboss.org/wiki/JBossEAP5IntegrationwithWebSphereMQ link and configure RAR to the jboss 5.1. When I run the test connection that also succeeded.

There I include

* channel - SYSTEM.DEF.SVRCONN
* hostName - localhost
* port - 1414
* queueManager - ExampleQM
* transportType - CLIENT

and In my MDB I include

@MessageDriven( name="WMQMDBTest",
        activationConfig = 
        { 
            @ActivationConfigProperty(propertyName="messagingType",propertyValue="javax.jms.MessageListener"),
            @ActivationConfigProperty(propertyName = "destinationType",propertyValue = "javax.jms.Queue"),
            @ActivationConfigProperty(propertyName = "destination", propertyValue = "queA"),
            @ActivationConfigProperty(propertyName = "useJNDI", propertyValue = "true"),
            @ActivationConfigProperty(propertyName = "channel", propertyValue = "SYSTEM.DEF.SVRCONN"),
            @ActivationConfigProperty(propertyName = "hostName", propertyValue = "localhost"),
            @ActivationConfigProperty(propertyName = "queueManager", propertyValue = "QMA"),
            @ActivationConfigProperty(propertyName = "port", propertyValue = "1414"),
            @ActivationConfigProperty(propertyName = "transportType", propertyValue = "CLIENT"),
            @ActivationConfigProperty(propertyName = "username", propertyValue = "mqm"),
            @ActivationConfigProperty(propertyName = "password", propertyValue = "password")
        }) 
@TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
@ResourceAdapter(value = "wmq.jmsra.rar")

When I try to deploy the bean it says

DEPLOYMENTS IN ERROR:
  Deployment "jboss.j2ee:ear=integration-1.0-SNAPSHOT.ear,jar=business-logic-1.0-SNAPSHOT.jar,  
  name=WMQMDBTest,service=EJB3" is in error due to the following reason(s): 开发者_运维问答
javax.naming.NameNotFoundException: queA not bound


You've written

        @ActivationConfigProperty(propertyName = "destination", propertyValue = "queA"),
        @ActivationConfigProperty(propertyName = "useJNDI", propertyValue = "true"),

with the useJNDI property implying that 'queA' is the name under which the JMS Queue is bound into the JNDI namespace - this does not directly correspond to the queue you have defined here

DEFINE QLOCAL ('queA')

If you want it to refer to a physical WMQ queue on your queue manager then you need the useJNDI property set to false, in which case destination specifies the name of a queue on the queue manager, not a JNDI name. On the other hand, if you do want to use JNDI lookup of Destinations then you need to ensure that the destination name specified matches the Queue definition in the -ds.xml file, e.g.

        @ActivationConfigProperty(propertyName = "destination", propertyValue = "jms/request")

would correspond to

<mbean code="org.jboss.resource.deployment.AdminObject" name="jca.wmq:name=request_queue">
    <attribute name="JNDIName">jms/request</attribute>
    <depends optional-attribute-name="RARName">jboss.jca:service=RARDeployment,name='wmq.jmsra.rar'</depends>
    <attribute name="Type">javax.jms.Queue</attribute>
    <attribute name="Properties">
        baseQueueManagerName=QMA            
        baseQueueName=queA
    </attribute>
</mbean>

note the JNDIName attribute of the mbean corresponds to the destination name

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜