2014-12-02 6 views
0

TomEE 1.7에서 EJB 2 메시지 구동 Bean (MDB)을 배포하려는 프로젝트가 있습니다. 두 개의 Websphere MQ에서 메시지를 연결하고 읽으려면이 MDB가 필요합니다. 그러나 인터넷에서 충분한 설명서를 찾을 수 없었습니다. 어떤에서 내가 Websphere MQ configuration in JBoss에서 함께 분석 할 수있는 I는 연결이 큐 관리자에 설립 얻을 다음EJB 2 MDB를 사용하여 TomEE의 인바운드 Websphere MQ 구성

<Resource id="wmqRA" type="com.ibm.mq.connector.ResourceAdapterImpl" class-name="com.ibm.mq.connector.ResourceAdapterImpl"> 
    connectionConcurrency=5 
    maxConnections=10 
    logWriterEnabled=true 
    reconnectionRetryCount=5 
    reconnectionRetryInterval=300000 
    traceEnabled=false 
    traceLevel=3 

<Resource id="jms/ABC" type="javax.jms.ConnectionFactory" class-name="com.ibm.mq.connector.outbound.ManagedConnectionFactoryImpl"> 
    TransactionSupport=none 
    ResourceAdapter=wmqRA 
    HostName=10.190.129.132 
    Port=1414 
    QueueManager=<QueueManagerName> 
    Channel=<ChannelName> 
    TransportType=Client 
    UserName=mqm 
    Password=abc 
    </Resource> 

<Container id="wmq" type="MESSAGE"> 
    ResourceAdapter=wmqRA 
    MessageListenerInterface=javax.jms.MessageListener 
    ActivationSpecClass=com.ibm.mq.connector.inbound.ActivationSpecImpl 
</Container> 

<Resource id="wmq-javax.jms.QueueConnectionFactory" type="javax.jms.QueueConnectionFactory" class-name="com.ibm.mq.connector.outbound.ManagedQueueConnectionFactoryImpl"> 
TransactionSupport=xa 
ResourceAdapter=wmqRA 

<Resource id="wmq-javax.jms.TopicConnectionFactory" type="javax.jms.TopicConnectionFactory" class-name="com.ibm.mq.connector.outbound.ManagedTopicConnectionFactoryImpl"> 
TransactionSupport=xa 
ResourceAdapter=wmqRA 
</Resource> 

<Resource id="queue_id" type="javax.jms.Queue" class-name="com.ibm.mq.connector.outbound.MQQueueProxy"> 
arbitraryProperties 
baseQueueManagerName=<QueueManagerName> 
baseQueueName=<QueueName> 
CCSID=1208 
encoding=NATIVE 
expiry=APP 
failIfQuiesce=true 
persistence=APP 
priority=APP 
readAheadClosePolicy=ALL 
targetClient=JMS 
</Resource>` 

(runmqsc를 사용하여 검증)을 만들었지 만 한 메시지가 큐에 추가 될 때 EJB가 트리거/생성되지 않습니다.

방향을 많이 알려드립니다.

답변

0

많은 시행 착오 끝에 해결책을 찾았습니다. Tomee와 작업하기 위해 EJB2 용 ejb-jar.xml을 지정해야하는 것처럼 보입니다.

사용이

<message-driven> 
     <ejb-name>beanName</ejb-name> 
     <ejb-class>beanClass</ejb-class> 
     <messaging-type>javax.jms.MessageListener</messaging-type> 
     <transaction-type>Bean</transaction-type> 
     <message-destination-type>javax.jms.Queue</message-destination-type> 
     <activation-config> 
      <activation-config-property> 
       <activation-config-property-name>destinationType</activation-config-property-name> 
       <activation-config-property-value>javax.jms.Queue</activation-config-property-value> 
      </activation-config-property> 
      <activation-config-property> 
       <activation-config-property-name>destination</activation-config-property-name> 
       <activation-config-property-value>*queueName*</activation-config-property-value> 
      </activation-config-property> 
      <activation-config-property> 
       <activation-config-property-name>channel</activation-config-property-name> 
       <activation-config-property-value>*channelName*</activation-config-property-value> 
      </activation-config-property> 
      <activation-config-property> 
       <activation-config-property-name>hostName</activation-config-property-name> 
       <activation-config-property-value>*hostName*</activation-config-property-value> 
      </activation-config-property> 
      <activation-config-property> 
       <activation-config-property-name>port</activation-config-property-name> 
       <activation-config-property-value>1414</activation-config-property-value> 
      </activation-config-property> 
      <activation-config-property> 
       <activation-config-property-name>queueManager</activation-config-property-name> 
       <activation-config-property-value>*queueManager*</activation-config-property-value> 
      </activation-config-property> 
      <activation-config-property> 
       <activation-config-property-name>transportType</activation-config-property-name> 
       <activation-config-property-value>CLIENT</activation-config-property-value> 
      </activation-config-property> 
      </activation-config>