Uploaded image for project: 'JBoss Enterprise Application Platform'
  1. JBoss Enterprise Application Platform
  2. JBEAP-4420

[Documentation] - Migration Guide - Migrate messaging data using JMS Bridges

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Blocker Blocker
    • 7.0.0.CR2
    • 7.0.0.CR2
    • Documentation
    • None

      To migrate messages from HornetQ (EAP 6) to Artemis (EAP 7) is possible to use JMS Bridges. JMS Bridge moves messages from one JMS destination to another. We will describe how to deploy JMS bridge on EAP 7 to move messages from HornetQ queue deployed into Artemis queue deployed on EAP 7.

      To deploy JMS Bridge to EAP 7 which will move messages from remote HornetQ server from EAP6 to Artemis to EAP 7, it is necessary to do following things.

      1. Shutdown EAP 6 server and backup HornetQ journal and configuration. HornetQ journal is by default located in $JBOSS_HOME/standalone/data/ directory - messagingbindings, messagingjournal, messaginglargemessages, messagingpaging. Directories messaginglargemessages, messagingpaging does not have to be present as there might be no large messages or paging is disabled.

      2. Then on WF10/EAP7 side configure JMS Bridge like:

           <subsystem xmlns="urn:jboss:domain:messaging-activemq:1.0">  
                      <server name="default">  
                          ...  
                          <connection-factory name="InVmConnectionFactory" factory-type="XA_GENERIC" entries="java:/ConnectionFactory" connectors="in-vm"/>  
                          <jms-queue name="OutQueue" entries="jms/queue/OutQueue java:jboss/exported/jms/queue/OutQueue"/>
                          ...  
                      </server>  
                      <jms-bridge name="myBridge" add-messageID-in-header="true" max-batch-time="100" max-batch-size="10" max-retries="-1" failure-retry-interval="1000" quality-of-service="AT_MOST_ONCE" module="org.hornetq">  
                          <source destination="jms/queue/InQueue" connection-factory="jms/RemoteConnectionFactory">  
                              <source-context>  
                                  <property name="java.naming.factory.initial" value="org.jboss.naming.remote.client.InitialContextFactory"/>  
                                  <property name="java.naming.provider.url" value="remote://127.0.0.1:4447"/>  
                              </source-context>  
                          </source>  
                          <target destination="jms/queue/OutQueue" connection-factory="java:/ConnectionFactory"/>  
                      </jms-bridge>  
                  </subsystem>  
      

      3. Because JMS Bridge needs HornetQ classes to make connection to HornetQ server in EAP 6, it's using "org.hornetq" module. This module and its direct dependencies are not present in EAP 7 and it's necessary to create them. Don't use org.hornetq.client module for JMS Bridge, it'll not work.

      Copy org.hornetq module and its dependencies org.jboss.netty module from EAP 6 modules directory to EAP 7.
      In case that you're using EAP 6.4.x.CP then copy:

      $EAP6_HOME/modules/system/layers/base/.overlays/layer-base-jboss-eap-6.4.x.CP/org/hornetq/ to $EAP7_HOME/modules/system/layers/base/org/  
      

      You're using server which does not have patched hornetq module then use copy:

      $EAP6_HOME/modules/system/layers/base/org/hornetq/ to $EAP7_HOME/modules/system/layers/base/org/  
      

      Now copy org.jboss.netty module (again if it's patched then search for it in ${EAP6_HOME}/modules/system/layers/base/.overlays/ directory):

      $EAP6_HOME/modules/system/layers/base/org/jboss/netty/ to $EAP7_HOME/modules/system/layers/base/org/jboss/ 
      

      3a. In case that you copied patched HornetQ module in step 3., open $EAP7_HOME/modules/system/layers/base/org/hornetq/main/module.xml file and remove line:

      <resource-root path="../../../../../org/hornetq/main/lib"/>  
      

      4. Now just make sure that EAP6 server contains configuration for RemoteConnectionFactory and InQueue for example like:

              <subsystem xmlns="urn:jboss:domain:messaging:1.4">
      ...
      		    <jms-queue name="InQueue">
                              <entry name="jms/queue/InQueue"/>
                              <entry name="java:jboss/exported/jms/queue/InQueue"/>
                              <durable>true</durable>
                          </jms-queue>
         		    <connection-factory name="RemoteConnectionFactory">  
                                  <factory-type>XA_GENERIC</factory-type>  
                                  <connectors>  
                                      <connector-ref connector-name="netty"/>  
                                  </connectors>  
                                  <entries>  
                                      <entry name="java:jboss/exported/jms/RemoteConnectionFactory"/>  
                                  </entries>  
                                  <ha>true</ha>  
                                  <block-on-acknowledge>true</block-on-acknowledge>  
                                  <retry-interval>1000</retry-interval>  
                                  <retry-interval-multiplier>1.0</retry-interval-multiplier>  
                                  <reconnect-attempts>-1</reconnect-attempts>  
                              </connection-factory> 
      ... 
      	</subsystem>
      

      5. Double check that you provided correct names for queues/topics, correct java.naming.provider.url for JNDI lookup and in case that you have configured security on EAP6, also provide correct user name and password for JNDI lookup in source-context and for creating connection to <source ...> tag in configuration of JMS Bridge. Also make sure that you've deployed target JMS destination in EAP 7 server.

      6. Start both of the servers.

              sgilda_jira Sande Gilda (Inactive)
              mnovak1@redhat.com Miroslav Novak
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: