3 Replies Latest reply on Jun 15, 2016 5:49 AM by mnovak

    How to access JMS Destinations defined in EAP 7 (ActiveMQ Artemis) from EAP 6.4?

    buehlmann

      Hi,

       

      I'm wondering which possibilities exist to access JMS destinations defined in JBoss EAP 7 from an application which is deployed in EAP 6.4?

      Is it possible to access the destinations from EAP 6.4 without any Artemis Resource Adaper deployed in EAP 6.4? For example by using AMQP? I could not find any documentation or examples in EAP 6.4 and EAP 7.

       

      Any hints will be greatly appreciated!

      Ben

        • 1. Re: How to access JMS Destinations defined in EAP 7 (ActiveMQ Artemis) from EAP 6.4?
          mnovak

          It's possible to do so. In short legacy connection factory must be created on EAP 7 server. For this is necessary to create new acceptor and connector on some port(5445) to which EAP 6.4 server will connect. Also you will need to open remoting port for JNDI lookups and add legacy jndi name to your queue.

           

          Here are CLI commands I used to do that on EAP 7 server:

          /socket-binding-group=standard-sockets/socket-binding=messaging:add(port=5445)
          /socket-binding-group=standard-sockets/socket-binding=remoting:add(port=4447)
          /subsystem=messaging-activemq/server=default/remote-acceptor=remote-acceptor:add(socket-binding=messaging)
          /subsystem=messaging-activemq/server=default/remote-connector=remote-connector:add(socket-binding=messaging)
          /:reload
          /subsystem=messaging-activemq/server=default/legacy-connection-factory=HornetQConnectionFactory:add(connectors=["remote-connector"], entries=["java:jboss/exported/jms/HornetQRemoteConnectionFactory"])
          /subsystem=remoting/connector=remoting:add(socket-binding=remoting)
          /:reload
          /subsystem=messaging-activemq/server=default/jms-queue=MyQueue:add(entries=["java:jboss/exported/jms/queue/MyQueue"], legacy-entries=["java:jboss/exported/jms/queue/LegacyMyQueue"])
          
          # disable security as it's not needed
          /subsystem=messaging-activemq/server=default:write-attribute(name=security-enabled,value=false)
          /:reload
          

           

          Lookup from EAP 6.4 server can be done by:

            final Properties env = new Properties();
            env.put(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.naming.remote.client.InitialContextFactory");
            env.put(Context.PROVIDER_URL, "remote://127.0.0.1:4447");
            context = new InitialContext(env);
            ConnectionFactory cf = (ConnectionFactory) context.lookup("jms/HornetQRemoteConnectionFactory");
            Queue queue = (Queue) context.lookup("jms/queue/LegacyMyQueue");
          
          • 2. Re: How to access JMS Destinations defined in EAP 7 (ActiveMQ Artemis) from EAP 6.4?
            buehlmann

            Hi Miroslav,

             

            Thank you very much for the reply. I will test this the next few days. Which protocol will be used when defining the connection this way? I assume the HornetQ proprietary protocol?

             

            Best,
            Ben

            • 3. Re: How to access JMS Destinations defined in EAP 7 (ActiveMQ Artemis) from EAP 6.4?
              mnovak

              Yes, with this configuration HornetQ Core protocol will be used. There is no other (supported/tested) option for this use case as AMQP and STOMP protocols were removed from Artemis from EAP 7. However Artemis as standalone messaging provides them. Also A-MQ 7 which is product based on Artemis will support them.