1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Anuncie Aqui
    Anuncie aqui você Também: fdantas@4each.com.br

[JBoss] Migration from JBoss embedded JMS broker to remote ActiveMQ Artemis

Discussão em 'StackOverflow' iniciado por Stack, Novembro 21, 2025.

  1. Stack

    Stack Membro Participativo

    I need to migrate all queues and topics from the existing JBoss embedded JMS broker to a remote ActiveMQ Artemis broker (i.e. outside JBoss server).

    I configured both embedded broker and remote broker in same standalone-full.xml file. Removed one queue from the embedded broker, and added it to the remote broker and pointed producers and consumers to the remote broker queue. After migrating all the queues/topics completely I'll remove the embedded broker.

    Here's the subsystem config:

    <subsystem xmlns="urn:jboss:domain:messaging-activemq:15.0">
    <server name="default">
    <in-vm-connector name="in-vm" server-id="0"/>
    <in-vm-acceptor name="in-vm" server-id="0"/>

    <!-- embedded queues -->
    <jms-queue name="DemoLocalQueue" entries="java:/jms/queue/DemoLocalQueue"/>

    <!-- Migrated to Remote broker -->
    <!-- <jms-queue name="TestQueue" entries="java:/jms/queue/TestQueue"/> -->

    <!-- Default embedded CFs -->
    <connection-factory name="InVmConnectionFactory"
    entries="java:/ConnectionFactory"
    connectors="in-vm"/>
    <pooled-connection-factory name="activemq-ra"
    entries="java:/JmsXA java:jboss/DefaultJMSConnectionFactory"
    connectors="in-vm"
    transaction="xa"/>

    </server>

    <!-- ===== Remote Artemis connector + pooled CF ===== -->
    <remote-connector name="remote-broker-connector" socket-binding="remote-broker"/>
    <pooled-connection-factory
    name="DemoRemoteCF"
    entries="java:/jms/DemoRemoteCF java:jboss/exported/jms/DemoRemoteCF"
    connectors="remote-broker-connector"
    reconnect-attempts="-1"
    user="${DEMO_JMS_USER}"
    password="${DEMO_JMS_PASS}"/>
    </subsystem>


    Added below socket binding:

    <outbound-socket-binding name="remote-broker">
    <remote-destination host="172.xxx.xxx.xxx" port="61616"/>
    </outbound-socket-binding>


    The MDB for the TestQueue is as below:

    @MessageDriven(activationConfig = {
    @ActivationConfigProperty(propertyName="destination", propertyValue="TestQueue"),
    @ActivationConfigProperty(propertyName="destinationType", propertyValue="jakarta.jms.Queue"),
    @ActivationConfigProperty(propertyName="connectionFactoryLookup", propertyValue="java:/jms/DemoRemoteCF"),
    @ActivationConfigProperty(propertyName="acknowledgeMode", propertyValue="Auto-acknowledge"),
    @ActivationConfigProperty(propertyName="useJNDI", propertyValue="false"),
    @ActivationConfigProperty(propertyName="maxSession", propertyValue="1")
    })
    public class DemoConnectorMDB implements MessageListener {
    public void onMessage(Message m) { /* ... */ }
    }


    When Start the JBoss server, it continuously logs

    10:13:24,525 INFO [org.apache.activemq.artemis.ra.ActiveMQRALogger] (default-threads - 4) AMQ151000: awaiting topic/queue creation TestQueue
    10:13:26,525 INFO [org.apache.activemq.artemis.ra.ActiveMQRALogger] (default-threads - 4) AMQ151004: Instantiating jakarta.jms.Queue "TestQueue" directly since UseJNDI=false.
    10:13:26,528 INFO [org.apache.activemq.artemis.ra.ActiveMQRALogger] (default-threads - 4) AMQ151000: awaiting topic/queue creation TestQueue
    10:13:28,529 INFO [org.apache.activemq.artemis.ra.ActiveMQRALogger] (default-threads - 4) AMQ151004: Instantiating jakarta.jms.Queue "TestQueue" directly since UseJNDI=false.
    10:13:28,535 INFO [org.apache.activemq.artemis.ra.ActiveMQRALogger] (default-threads - 4) AMQ151000: awaiting topic/queue creation TestQueue
    10:13:30,536 INFO [org.apache.activemq.artemis.ra.ActiveMQRALogger] (default-threads - 4) AMQ151004: Instantiating jakarta.jms.Queue "TestQueue" directly since UseJNDI=false.
    10:13:30,538 INFO [org.apache.activemq.artemis.ra.ActiveMQRALogger] (default-threads - 4) AMQ151000: awaiting topic/queue creation TestQueue
    10:13:32,539 INFO [org.apache.activemq.artemis.ra.ActiveMQRALogger] (default-threads - 4) AMQ151004: Instantiating jakarta.jms.Queue "TestQueue" directly since UseJNDI=false.
    10:13:32,541 INFO [org.apache.activemq.artemis.ra.ActiveMQRALogger] (default-threads - 4) AMQ151000: awaiting topic/queue creation TestQueue
    10:13:34,542 INFO [org.apache.activemq.artemis.ra.ActiveMQRALogger] (default-threads - 4) AMQ151004: Instantiating jakarta.jms.Queue "TestQueue" directly since UseJNDI=false.
    10:13:34,550 INFO [org.apache.activemq.artemis.ra.ActiveMQRALogger] (default-threads - 4) AMQ151000: awaiting topic/queue creation TestQueue
    10:13:36,551 INFO [org.apache.activemq.artemis.ra.ActiveMQRALogger] (default-threads - 4) AMQ151004: Instantiating jakarta.jms.Queue "TestQueue" directly since UseJNDI=false.
    10:13:36,554 INFO [org.apache.activemq.artemis.ra.ActiveMQRALogger] (default-threads - 4) AMQ151000: awaiting topic/queue creation TestQueue
    10:13:38,554 INFO [org.apache.activemq.artemis.ra.ActiveMQRALogger] (default-threads - 4) AMQ151004: Instantiating jakarta.jms.Queue "TestQueue" directly since UseJNDI=false.
    10:13:38,556 INFO [org.apache.activemq.artemis.ra.ActiveMQRALogger] (default-threads - 4) AMQ151000: awaiting topic/queue creation TestQueue
    10:13:40,557 INFO [org.apache.activemq.artemis.ra.ActiveMQRALogger] (default-threads - 4) AMQ151004: Instantiating jakarta.jms.Queue "TestQueue" directly since UseJNDI=false.
    10:13:40,563 INFO [org.apache.activemq.artemis.ra.ActiveMQRALogger] (default-threads - 4) AMQ151000: awaiting topic/queue creation TestQueue
    10:13:42,563 INFO [org.apache.activemq.artemis.ra.ActiveMQRALogger] (default-threads - 4) AMQ151004: Instantiating jakarta.jms.Queue "TestQueue" directly since UseJNDI=false.
    10:13:42,565 INFO [org.apache.activemq.artemis.ra.ActiveMQRALogger] (default-threads - 4) AMQ151000: awaiting topic/queue creation TestQueue
    10:13:44,566 INFO [org.apache.activemq.artemis.ra.ActiveMQRALogger] (default-threads - 4) AMQ151004: Instantiating jakarta.jms.Queue "TestQueue" directly since UseJNDI=false.


    I could produce messages into the TestQueue but MDB did not consume those messages from the TestQueue. Any solutions for this issue would be really helpful.

    Continue reading...

Compartilhe esta Página