[jboss-cvs] JBoss Messaging SVN: r3959 - branches/Branch_JBossMessaging_1_4_0_SP3_CP/docs/userguide/en/modules.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu Mar 27 07:09:41 EDT 2008


Author: ataylor
Date: 2008-03-27 07:09:40 -0400 (Thu, 27 Mar 2008)
New Revision: 3959

Modified:
   branches/Branch_JBossMessaging_1_4_0_SP3_CP/docs/userguide/en/modules/installation.xml
Log:
http://jira.jboss.org/jira/browse/JBMESSAGING-1242?page=all - added  Migrating Messages from JBoss MQ to JBoss Messaging chapter

Modified: branches/Branch_JBossMessaging_1_4_0_SP3_CP/docs/userguide/en/modules/installation.xml
===================================================================
--- branches/Branch_JBossMessaging_1_4_0_SP3_CP/docs/userguide/en/modules/installation.xml	2008-03-27 10:30:39 UTC (rev 3958)
+++ branches/Branch_JBossMessaging_1_4_0_SP3_CP/docs/userguide/en/modules/installation.xml	2008-03-27 11:09:40 UTC (rev 3959)
@@ -803,4 +803,209 @@
          </listitem>
       </itemizedlist>
    </section>
+   <section id="inst.mqmessagemigration">
+      <title>Migrating Messages from JBoss MQ to JBoss Messaging</title>
+      <para>This configuration will allow you to migrate your systems using JBossMQ to JBM(JBoss Messaging).
+         Many Enterprise systems are complex and have multiple applications and can't be migrated from JBossMQ to
+         JBM all at one time.</para>
+      <para>Made up Use Case: For instance, your business is selling items, some you make directly and some you farm
+         out to other distributors. Your ordering system is JBossMQ based. Customers place orders that are then queued
+         up to be processed(via JBossMQ). You also use MQ to queue up the orders that you need to produce and you also
+         queue up the orders that will go to your other distributors. You use MDB's in three separate places in your
+         operation. You want to do a staged migration from JBossMQ to JBM. That requires that JBossMQ and JBM work
+         together. This is exactly what the JBM bridge was meant to do. It's meant to take messages from one queue/topic
+         and transfer them to another queue/topic. This helps with the migration by allowing you to pull messages from
+         your JBossMQ queues automatically and push them into your JBM Queues. You can also do the opposite, you can
+         push messages from your JBM system to your JBossMQ system. In our example, we want to replace the ordering
+         side(producer) with JBM. We push messages into the JBM Order queue, but we set the bridge up to send all of
+         those messages to the JBossMQ Order queue. The rest of your processing happens as normal. Lets say you want
+         to leave your ordering system intact, but you want to have JBM and EJB3 MDBs process the orders. You can have
+         your old client put messages in JBossMQ as normal, but you set the bridge up to pull the messages from JBossMQ
+         Order queue and push them into the JBM Order queue.</para>
+      <para>This allows JBM and JBossMQ to interact together by pushing messages back and forth between different systems.</para>
+      <para>The Following Assumptions are made:</para>
+      <itemizedlist>
+         <listitem>You have one JBoss instance set up for JBoss Messaging and One Jboss instance set up that has your old JBoss MQ on it.</listitem>
+         <listitem>We are copying messages from JBossMQ(Source) to JBM(Target)</listitem>
+      </itemizedlist>
+      <section id="inst.mqmessagemigration.steps">
+         <title>Steps to Set up the bridge</title>
+         <itemizedlist>
+            <listitem>
+               <para>Copy the jbossmq.jar from the Source Machine(JBossMQ) under the server/default/lib/ to the
+                  messaging configuration on the Target JBM machine(server/messaging/lib)</para>
+               <note>substitute what ever your messaging server configuration is above. I used the default stand alone
+                  messaging server configuration note: This is required to dereference the JBossMQ objects that are
+                  dereferenced on the JBM side. If you don't copy the jar over, you will get a
+                  "java.lang.ClassCastException: javax.naming.Reference" exception and the bridge will not be able to start</note>
+            </listitem>
+            <listitem><para>Add the remote JBossMQ provider to the jms-ds.xml file in the server/messaging/deploy
+               directory on your target(JBM) machine.</para>
+               <para>Here is an example of the provider to add.</para>
+            <programlisting>
+&lt;mbean code="org.jboss.jms.jndi.JMSProviderLoader"
+               name="jboss.messaging:service=JMSProviderLoader,
+               name=MyRemoteJMSProvider"&gt;
+  &lt;attribute name="ProviderName"&gt;RemoteXAConnectionFactory&lt;/attribute&gt;
+  &lt;attribute name="ProviderAdapterClass"&gt;org.jboss.jms.jndi.JNDIProviderAdapter&lt;/attribute&gt;
+  &lt;!-- The combined connection factory --&gt;
+  &lt;attribute name="FactoryRef"&gt;XAConnectionFactory&lt;/attribute&gt;
+  &lt;!-- The queue connection factory --&gt;
+  &lt;attribute name="QueueFactoryRef"&gt;XAConnectionFactory&lt;/attribute&gt;
+  &lt;!-- The topic factory --&gt;
+  &lt;attribute name="TopicFactoryRef"&gt;XAConnectionFactory&lt;/attribute&gt;
+  &lt;attribute name="Properties"&gt;
+     java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
+     java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
+     java.naming.provider.url=192.168.0.199:1099
+  &lt;/attribute&gt;
+&lt;/mbean&gt;
+            </programlisting>
+               <note>you will need to change the java.naming.provider.url so that it points to your JBossMQ machine.
+                  Everything else should remain the same. Keep your jms-ds.xml file open, because you will be addning
+                  another entry in it for the next step.</note>
+            </listitem>
+            <listitem>
+               <para>Add the Bridge provider to the jms-ds.xml file in the server/messaging/deploy directory on your
+                  target(JBM) machine.</para>
+               <para>Here is an example bridge configuration</para>
+               <programlisting>
+&lt;mbean code="org.jboss.jms.server.bridge.BridgeService"
+                  name="jboss.messaging:service=Bridge,name=TestBridge"
+                  xmbean-dd="xmdesc/Bridge-xmbean.xml"&gt;
+     &lt;depends optional-attribute-name="SourceProviderLoader"&gt;
+                  jboss.messaging:service=JMSProviderLoader,
+                  name=MyRemoteJMSProvider&lt;/depends&gt;
+     &lt;depends optional-attribute-name="TargetProviderLoader"&gt;
+                  jboss.messaging:service=JMSProviderLoader,
+                  name=JMSProvider&lt;/depends&gt;
+     &lt;attribute name="SourceDestinationLookup"&gt;/queue/testQueue&lt;/attribute&gt;
+     &lt;attribute name="TargetDestinationLookup"&gt;/queue/A&lt;/attribute&gt;
+     &lt;attribute name="QualityOfServiceMode"&gt;0&lt;/attribute&gt;
+     &lt;attribute name="MaxBatchSize"&gt;5&lt;/attribute&gt;
+     &lt;attribute name="MaxBatchTime"&gt;-1&lt;/attribute&gt;
+     &lt;attribute name="FailureRetryInterval"&gt;5000&lt;/attribute&gt;
+     &lt;attribute name="MaxRetries"&gt;-1&lt;/attribute&gt;
+     &lt;attribute name="AddMessageIDInHeader"&gt;false&lt;/attribute&gt;
+&lt;/mbean&gt;                  
+               </programlisting>
+               <note>my target is the current JBM JMS Provider and the source is the JBossMQ remote provider. If you
+                  have a pretty stock system and you want to move messages from JBossMQ to JBM, you will not have to
+                  change this example except for the queue Names. If you wish to move from JBM to JBossMQ, just switch
+                  the soure and target definitions.</note>
+            </listitem>
+         </itemizedlist>
+         <para>Start the JBossMQ system and then just start the JBM system and the messages will begin to move over.</para>
+         <para>The following is an example of the jms-ds.xml file that was used for the test. If you want to test the bridge first 
+            and you have a stock JBM system(JBM has been installed using the default configuration), then you can just
+            copy the jms-ds.xml file over the one in server/messaging/deploy and begin to put messages in the JBossMQ
+            system under the /queue/TestQueue. The messages will then be moved over to your JBM queue /queue/A. Both of
+            these queues exist in the stock versions of JBM and JBossMQ.</para>
+      </section>
+      <programlisting>
+&lt;?xml version="1.0" encoding="UTF-8"?&gt;
+
+&lt;connection-factories&gt;
+
+  &lt;!-- ==================================================================== --&gt;
+  &lt;!-- JMS Stuff                                                            --&gt;
+  &lt;!-- ==================================================================== --&gt;
+
+  &lt;!-- The JMS provider loader --&gt;
+  &lt;mbean code="org.jboss.jms.jndi.JMSProviderLoader"
+    name="jboss.messaging:service=JMSProviderLoader,name=JMSProvider"&gt;
+    &lt;attribute name="ProviderName"&gt;DefaultJMSProvider&lt;/attribute&gt;
+
+    &lt;attribute name="ProviderAdapterClass"&gt;
+      org.jboss.jms.jndi.JNDIProviderAdapter
+    &lt;/attribute&gt;
+    &lt;!-- The combined connection factory --&gt;
+    &lt;attribute name="FactoryRef"&gt;java:/XAConnectionFactory&lt;/attribute&gt;
+    &lt;!-- The queue connection factory --&gt;
+    &lt;attribute name="QueueFactoryRef"&gt;java:/XAConnectionFactory&lt;/attribute&gt;
+    &lt;!-- The topic factory --&gt;
+
+    &lt;attribute name="TopicFactoryRef"&gt;java:/XAConnectionFactory&lt;/attribute&gt;
+    &lt;!-- Uncomment to use HAJNDI to access JMS
+    &lt;attribute name="Properties"&gt;
+       java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
+       java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
+       java.naming.provider.url=localhost:1100
+    &lt;/attribute&gt;
+    --&gt;
+  &lt;/mbean&gt;
+
+
+&lt;mbean code="org.jboss.jms.jndi.JMSProviderLoader"
+         name="jboss.messaging:service=JMSProviderLoader,
+         name=MyRemoteJMSProvider"&gt;
+     &lt;attribute name="ProviderName"&gt;RemoteXAConnectionFactory&lt;/attribute&gt;
+     &lt;attribute name="ProviderAdapterClass"&gt;org.jboss.jms.jndi.JNDIProviderAdapter&lt;/attribute&gt;
+     &lt;!-- The combined connection factory --&gt;
+
+     &lt;attribute name="FactoryRef"&gt;XAConnectionFactory&lt;/attribute&gt;
+     &lt;!-- The queue connection factory --&gt;
+     &lt;attribute name="QueueFactoryRef"&gt;XAConnectionFactory&lt;/attribute&gt;
+     &lt;!-- The topic factory --&gt;
+     &lt;attribute name="TopicFactoryRef"&gt;XAConnectionFactory&lt;/attribute&gt;
+     &lt;attribute name="Properties"&gt;
+        java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
+        java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
+        java.naming.provider.url=192.168.0.199:1099
+     &lt;/attribute&gt;
+
+&lt;/mbean&gt;
+
+&lt;mbean code="org.jboss.jms.server.bridge.BridgeService"
+         name="jboss.messaging:service=Bridge,name=TestBridge"
+         xmbean-dd="xmdesc/Bridge-xmbean.xml"&gt;
+     &lt;depends optional-attribute-name="SourceProviderLoader"&gt;
+         jboss.messaging:service=JMSProviderLoader,
+         name=MyRemoteJMSProvider&lt;/depends&gt;
+     &lt;depends optional-attribute-name="TargetProviderLoader"&gt;
+         jboss.messaging:service=JMSProviderLoader,
+         name=JMSProvider&lt;/depends&gt;
+     &lt;attribute name="SourceDestinationLookup"&gt;/queue/testQueue&lt;/attribute&gt;
+     &lt;attribute name="TargetDestinationLookup"&gt;/queue/A&lt;/attribute&gt;
+     &lt;attribute name="QualityOfServiceMode"&gt;0&lt;/attribute&gt;
+
+     &lt;attribute name="MaxBatchSize"&gt;5&lt;/attribute&gt;
+     &lt;attribute name="MaxBatchTime"&gt;-1&lt;/attribute&gt;
+     &lt;attribute name="FailureRetryInterval"&gt;5000&lt;/attribute&gt;
+     &lt;attribute name="MaxRetries"&gt;-1&lt;/attribute&gt;
+     &lt;attribute name="AddMessageIDInHeader"&gt;false&lt;/attribute&gt;
+&lt;/mbean&gt;
+
+  &lt;!-- The server session pool for Message Driven Beans --&gt;
+  &lt;mbean code="org.jboss.jms.asf.ServerSessionPoolLoader"
+    name="jboss.messaging:service=ServerSessionPoolMBean,name=StdJMSPool"&gt;
+    &lt;depends optional-attribute-name="XidFactory"&gt;jboss:service=XidFactory&lt;/depends&gt;
+    &lt;attribute name="PoolName"&gt;StdJMSPool&lt;/attribute&gt;
+    &lt;attribute name="PoolFactoryClass"&gt;
+      org.jboss.jms.asf.StdServerSessionPoolFactory
+    &lt;/attribute&gt;
+  &lt;/mbean&gt;
+
+  &lt;!-- JMS XA Resource adapter, use this to get transacted JMS in beans --&gt;
+  &lt;tx-connection-factory&gt;
+    &lt;jndi-name&gt;JmsXA&lt;/jndi-name&gt;
+    &lt;xa-transaction/&gt;
+    &lt;rar-name&gt;jms-ra.rar&lt;/rar-name&gt;
+    &lt;connection-definition&gt;org.jboss.resource.adapter.jms.JmsConnectionFactory
+         &lt;/connection-definition&gt;
+    &lt;config-property name="SessionDefaultType" type="java.lang.String"&gt;javax.jms.Topic
+         &lt;/config-property&gt;
+
+    &lt;config-property name="JmsProviderAdapterJNDI" type="java.lang.String"&gt;
+         java:/DefaultJMSProvider&lt;/config-property&gt;
+    &lt;max-pool-size&gt;20&lt;/max-pool-size&gt;
+    &lt;security-domain-and-application&gt;JmsXARealm&lt;/security-domain-and-application&gt;
+  &lt;/tx-connection-factory&gt;
+
+&lt;/connection-factories&gt;
+
+      </programlisting>
+      <para>You can also merge topics back and forth from JBM to JBossMQ, by setting the subscription name and client id.
+         You can see these arguments in the JBM Bridge chapter. </para>
+   </section>
 </chapter>
\ No newline at end of file




More information about the jboss-cvs-commits mailing list