2
votes

I successfully configured the Wildfly server with ActiveMQ as flow

    <subsystem xmlns="urn:jboss:domain:messaging-activemq:1.0">
        <server name="default">
            <security enabled="false"/>
            <http-connector name="http-connector" socket-binding="http" endpoint="http-acceptor"/>
            <http-acceptor name="http-acceptor" http-listener="default"/>
            <jms-queue name="UpdateQueue" entries="java:/jms/UpdateQueue java:jboss/exported/jms/UpdateQueue"/>
            <connection-factory name="ConnectionFactory" entries="java:jboss/exported/jms/ConnectionFactory" connectors="http-connector"/>
        </server>
    </subsystem>

The messages send/receive successfully from the queue using default native javax.jms implementation.

I use the following configuration to access the JMS Queue to send/receive.

String EX_JNDI_FACTORY = "org.jboss.naming.remote.client.InitialContextFactory";
    String SERVER_URL = "http-remoting://127.0.0.1:8080";
    String JMS_FACTORY = "jms/ConnectionFactory";
    String QUEUE_NAME = "jms/UpdateQueue";

Most times the message took too long time between send and receive, sometimes its took 3 minutes between send and receive the message, I don't know the reason for this behavior. Any ideas?

1
'Hello Karim. Can you share your code + configs to create a MDB in wildfly? Im new to JBoss/wildfly and I'm having a really hard time trying to make an example run. This is what I have until now: gist.github.com/twimnox/0efea3bbfea53e6f8a49a2b82ed00537 Thanks in advance!Twimnox

1 Answers

1
votes

I class receive multiple time without close the receiver, session, and connection. I added the following code after qreceiver.receive(0) and everything run fine.

    try{
        if (qreceiver != null){
            qreceiver.close();
            qreceiver = null;
        }

        qsession.close();
        qcon.close();
    }catch (JMSException e) {
        e.printStackTrace();
    }