从wildfly11使用mdb连接到Jboss7.2中的HornetQ 2.3.0CR1队列

时间:2019-04-07 06:14:54

标签: jboss7.x hornetq jboss-wildfly-11

我无法启动wildfly11将mdb连接到jboss7.2的队列。

  1. 我尝试了简单的远程连接(Netty)服务器和客户端不兼容。

[org.apache.activemq.artemis.ra](默认线程-1)AMQ154003:无法重新连接org.apache.activemq.artemis.ra.inflow.ActiveMQActivationSpec(ra = org.wildfly.extension.messaging。 activemq.ActiveMQResourceAdapter@b2ed35d1 destination = jms / queue / teszt destinationType = javax.jms.Queue ack =自动确认持久性= false clientID = null user = null maxSession = 15): ActiveMQException [errorType = INCOMPATIBLE_CLIENT_SERVER_VERSIONS message = null]

  1. 我修补了jboss7.2 hornetq以支持123客户端。 (只是jar中的一个属性文件:) 它有效,但是我觉得这不是一个好的解决方案。只是一个探针。

  2. 我尝试将jboss7.2 hornetq 2.3.0CR1升级到2.3.0CR2。但是构建失败了,因为其他一些常量。

  3. 我从mvnreposirory搜索了资源适配器。 (hornetq-ra-2.3.0.CR1.jar) Mdb没有看到

错误[org.jboss.as.controller.management-operation](控制器引导线程)​​WFLYCTL0013:操作(“ deploy”)失败-地址:([(“ deployment” =>“ jms-receiver-0.0.1 -SNAPSHOT.war“)])-失败描述:{     “ WFLYCTL0412:未安装的必需服务:” => [“ jboss.ra.hornetq-ra”],     “ WFLYCTL0180:服务缺少/不可用的依赖项” => [“ jboss.deployment.unit。\” jms-receiver-0.0.1-SNAPSHOT.war \“。component.TesztMdb.CREATE丢失[jboss.ra.hornetq- ra]“] }

  1. 我尝试在jboss7.2中创建一个到wildfly11的jmsbridge,但是连接没有成功,我认为更好的解决方案是如果客户端连接到服务器而不是相反。

资源适配器: wildfly11

<subsystem xmlns="urn:jboss:domain:resource-adapters:5.0">
  <resource-adapters>
    <resource-adapter id="hornetq-ra">
      <archive>
        hornetq-ra-2.3.0.CR1.jar
      </archive>
      <transaction-support>XATransaction</transaction-support>
      <config-property name="ConnectionParameters"> host=localhost;port=6955
      </config-property>
      <config-property name="ConnectorClassName">
        org.hornetq.core.remoting.impl.netty.NettyConnectorFactory
      </config-property>
      <connection-definitions>
      <connection-definition class-name="org.hornetq.ra.HornetQRAManagedConnectionFactory" jndi-name="java:/FluxFactory" enabled="true" use-java-context="true" pool-name="Session" use-ccm="true">
        <config-property name="SessionDefaultType">
          javax.jms.Queue
        </config-property>
        <config-property name="UseTryLock">
          0
        </config-property>
        <xa-pool>
          <min-pool-size>0</min-pool-size>
          <max-pool-size>10</max-pool-size>
          <prefill>false</prefill>
          <use-strict-min>false</use-strict-min>
          <flush-strategy>FailingConnectionOnly</flush-strategy>
          <pad-xid>false</pad-xid>
          <wrap-xa-resource>true</wrap-xa-resource>
         </xa-pool>
       </connection-definition>
     </connection-definitions>
   </resource-adapter>
  </resource-adapters>
</subsystem>

<mdb>
  <resource-adapter-ref resource-adapter-name="hornetq-ra"/>
  <bean-instance-pool-ref pool-name="mdb-strict-max-pool"/>
</mdb>

5. bridge jboss7.2 side


<jms-bridge name="jms-bridge-name">
  <source>
    <connection-factory name="ConnectionFactory"/>
    <destination name="jms/queue/teszt"/>
  </source>
  <target>
  <connection-factory name="jms/RemoteConnectionFactory"/>
    <destination name="jms/queue/teszt"/>
<!-- jmsuser with the same password is registered in ApplicationRealm with permission to consume/send messages -->
    <user>MYUSER</user>
    <password>MYPASS</password>
    <context>
<!-- The username and password must be added to the context to allow remote registry lookup -->
       <property key="java.naming.factory.initial" value="org.jboss.naming.remote.client.InitialContextFactory"/>
    <property key="java.naming.provider.url" value="http-remoting://localhost:8080"/>
    <property key="java.naming.security.principal" value="halcsiapp"/>
                        <property key="java.naming.security.credentials" value="Alma123-"/>
    </context>
 </target>
 <quality-of-service>ONCE_AND_ONLY_ONCE</quality-of-service>
    <failure-retry-interval>10000</failure-retry-interval>
    <max-retries>10</max-retries>
    <max-batch-size>500</max-batch-size>
    <max-batch-time>50</max-batch-time>
    <add-messageID-in-header>true</add-messageID-in-header>
</jms-bridge>

0 个答案:

没有答案