ActiveMQ on Wildfly 12

0

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

Log:

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 code:

@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 { ... }

I'm using it in my standalone.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/nfe/queue/CadastrarNFe" use-java-context="true" pool-name="CadastrarNFe">
                        <config-property name="PhysicalName">
                            nfe/queue/CadastrarNFe
                        </config-property>
                    </admin-object>
                    <admin-object class-name="org.apache.activemq.command.ActiveMQQueue" jndi-name="java:jboss/cte/queue/ConsultarCTe" use-java-context="true" pool-name="ConsultarCTe">
                        <config-property name="PhysicalName">
                            cte/queue/ConsultarCTe
                        </config-property>
                    </admin-object>
                    <admin-object class-name="org.apache.activemq.command.ActiveMQQueue" jndi-name="java:jboss/nfe/queue/ConsultarNFe" use-java-context="true" pool-name="ConsultarNFe">
                        <config-property name="PhysicalName">
                            nfe/queue/ConsultarNFe
                        </config-property>
                    </admin-object>
                    <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-object class-name="org.apache.activemq.command.ActiveMQQueue" jndi-name="java:jboss/mdfe/queue/ConsultarMDFe" use-java-context="true" pool-name="ConsultarMDFe">
                        <config-property name="PhysicalName">
                            mdfe/queue/ConsultarMDFe
                        </config-property>
                    </admin-object>
                    <admin-object class-name="org.apache.activemq.command.ActiveMQQueue" jndi-name="java:jboss/cte/queue/CadastrarCTe" use-java-context="true" pool-name="CadastrarCTe">
                        <config-property name="PhysicalName">
                            cte/queue/CadastrarCTe
                        </config-property>
                    </admin-object>
                </admin-objects>
            </resource-adapter>
        </resource-adapters>
    </subsystem>

Detail ... this application works perfectly on Wildfly 10.

Has anyone ever caught something like this?

Hugs

    
asked by anonymous 11.07.2018 / 01:48

1 answer

0

I found the problem.

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

<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 ... This is the tip for anyone who has the same problem.

    
12.07.2018 / 12:50