2014-12-02 3 views
0

У меня есть проект, в котором я пытаюсь развернуть ведомые бобы EJB 2 (MDB) в TomEE 1.7. Мне нужны эти MDB для подключения и чтения сообщений из двух WebSphere MQ. Однако я не смог найти достаточную документацию в Интернете. С какой бы я мог разобрать вместе с Websphere MQ configuration in JBoss Я создал следующиеКонфигурирование входящей Websphere MQ в TomEE с EJB 2 MDB

<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

Получил решение после многих проб и ошибок. Похоже, нам нужно указать в ejb-jar.xml для EJB2 для работы с Tomee.

Используйте этот

<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> 
Смежные вопросы