1 Reply Latest reply on Jul 12, 2018 6:53 AM by RICARDO NEVES

    Error in Wildfly 12 using ActiveMQ

    RICARDO NEVES Newbie

      I'm migrating an application to Wildfly 12 and I do not connect in my queue using ActiveMQ.

       

      20:27:21,862 INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0025: WildFly Full 12.0.0.Final (WildFly Core 4.0.0.Final) started in 34602ms - Started 4147 of 4322 services (367 services are lazy, passive or on-demand)
      20:27:22,032 INFO  [org.apache.activemq.artemis.ra] (default-threads - 2) AMQ151000: awaiting topic/queue creation mdfe/queue/ConsultarMDFe
      20:27:22,063 INFO  [org.apache.activemq.artemis.ra] (default-threads - 1) AMQ151000: awaiting topic/queue creation mdfe/queue/CadastrarMDFe
      20:27:24,038 INFO  [org.apache.activemq.artemis.ra] (default-threads - 2) AMQ151001: Attempting to reconnect org.apache.activemq.artemis.ra.inflow.ActiveMQActivationSpec(ra=org.wildfly.extension.messaging.activemq.ActiveMQResourceAdapter@2bd07716 destination=mdfe/queue/ConsultarMDFe destinationType=javax.jms.Queue ack=Auto-acknowledge durable=false clientID=null user=null maxSession=15)
      20:27:24,068 INFO  [org.apache.activemq.artemis.ra] (default-threads - 1) AMQ151001: Attempting to reconnect org.apache.activemq.artemis.ra.inflow.ActiveMQActivationSpec(ra=org.wildfly.extension.messaging.activemq.ActiveMQResourceAdapter@2bd07716 destination=mdfe/queue/CadastrarMDFe destinationType=javax.jms.Queue ack=Auto-acknowledge durable=false clientID=null user=null maxSession=15)

       

      My listener:

       

      @MessageDriven(activationConfig = {
           @ActivationConfigProperty(propertyName = "acknowledgeMode", propertyValue="Auto-acknowledge"),
           @ActivationConfigProperty(propertyName="destinationType", propertyValue="javax.jms.Queue"),
           @ActivationConfigProperty(propertyName="destination", propertyValue="mdfe/queue/CadastrarMDFe")})
      public class MDFeQueueListener implements MessageListener { 
           ...
      }

       

      My standalone-full.xml:

       

      <subsystem xmlns="urn:jboss:domain:resource-adapters:5.0">

           <resource-adapters>

                <resource-adapter id="activemq">

                     <archive>activemq-rar-5.15.4.rar</archive>
                     <transaction-support>XATransaction</transaction-support>
                     <config-property name="ServerUrl">tcp://localhost:61616</config-property>
                     <config-property name="UserName">username</config-property>
                     <config-property name="UseInboundSession">false</config-property>

                     <config-property name="Password">password</config-property>
                     <connection-definitions>
                          <connection-definition class-name="org.apache.activemq.ra.ActiveMQManagedConnectionFactory" jndi-name="java:/ConnectionFactory" enabled="true" pool-name="ConnectionFactory">
                              
      <xa-pool>
                                    <min-pool-size>1</min-pool-size>
                                    <max-pool-size>20</max-pool-size>
                                    <prefill>false</prefill>
                                    <is-same-rm-override>false</is-same-rm-override>
                               </xa-pool>
                          </connection-definition>
                     </connection-definitions>
                     <admin-objects>
                          <admin-object class-name="org.apache.activemq.command.ActiveMQQueue" jndi-name="java:jboss/mdfe/queue/CadastrarMDFe" use-java-context="true" pool-name="CadastrarMDFe">
                               <config-property name="PhysicalName">mdfe/queue/CadastrarMDFe</config-property>
                          </admin-object>
                     </admin-objects>
                </resource-adapter>
           </resource-adapters>
      </subsystem>

       

      This code runs on wildfly 10 perfectly.

       

      tks

        • 1. Re: Error in Wildfly 12 using ActiveMQ
          RICARDO NEVES Newbie

          I found the problem.

           

          The ** resource-adapter-name ** attribute of the ** mdb ** tag was incorrect (it was not referencing the tag ID ** resource-adapter **).

           

              <mdb>

                  <resource-adapter-ref resource-adapter-name="${ejb.resource-adapter-name:activemq-ra.rar}"/>

                  <bean-instance-pool-ref pool-name="mdb-strict-max-pool"/>

              </mdb>

              ...

              <subsystem xmlns="urn:jboss:domain:resource-adapters:5.0">

                  <resource-adapters>

                      <resource-adapter id="activemq">

                          ...

                      </resource-adapter>

                  </resource-adapters>

              </subsystem>

           

          I changed to:

           

              <mdb>

                  <resource-adapter-ref resource-adapter-name="activemq"/>

                  <bean-instance-pool-ref pool-name="mdb-strict-max-pool"/>

              </mdb>

           

          And it worked ... That's the tip for anyone who has the same problem.