9 Replies Latest reply on Apr 16, 2007 3:13 PM by Vincent Tran

    Multiple Destination Mgr and Pesistence Managers

    sys user Master

      H,
      Can I have multiple destination managers and multiple persistence managers.
      Basically I need the logging message queue persist to Database-1
      and my application message queue persist to Database-2.
      So can I have two sets of Destination and persistence managers?

      thanks
      Kal

        • 1. Re: Multiple Destination Mgr and Pesistence Managers
          Elias Ross Master


          You can create multiple PersistenceManagers. A queue you create on the server is assigned to a PM.

          You can take the configuration that ships with JBoss, modify the ObjectNames to something else, and when you create the Queue, do this:


          <depends optional-attribute-name="DestinationManager">jboss.mq:service=DestinationManager,ver=2


          Here are some of the names you'll have to change:

          jboss.mq:service=Invoker
          jboss.mq:service=DestinationManager
          jboss.mq:service=PersistenceManager

          I haven't tested this... But ought to work.

          • 2. Re: Multiple Destination Mgr and Pesistence Managers
            sys user Master

            doesnt work
            looks like you can have only one PM active for a JBoss instance

            • 3. Re: Multiple Destination Mgr and Pesistence Managers
              Tim McCune Novice

              genman is right. I was able make this work, but it wasn't immediately obvious how. I needed to do this because I am using both local and HA JMS destinations. HA JMS destinations need to use a JDBC persistence manager that all point to the same database so that when the destination bounces to a new cluster node, it can restore the messages to the destination. For local JMS destinations, this causes big problems because multiple cluster nodes will collide at the database. I used the file persistence manager for my local destinations. Here were the steps I followed to make this work (I already had the JDBC persistence manager configured.)

              1) Set up file-pm-service.xml in deploy/jms. Change all object names so that they don't collide with the jdbc pm (i.e. LocalDestinationManager, LocalMessageCache, LocalCacheStore, and LocalPersistenceManager.)

              2) Create a 2nd invoker (i.e. LocalInvoker) in jbossmq-service.xml that is a copy of the Invoker (with local versions of all configured interceptors.) LocalInvoker needs to use LocalDestinationManager.

              3) Point jvm-il-service.xml at LocalInvoker instead of Invoker. (All other invokers (e.g. UIL2) still point at Invoker.

              4) Modify my local destinations to point at LocalDestinationManager instead of DestinationManager (e.g.

              <mbean code="org.jboss.mq.server.jmx.Topic" name="jboss.mq.destination:service=Topic,name=MyTopic">
               <depends optional-attribute-name="DestinationManager">
               jboss.mq:service=LocalDestinationManager
               </depends>
              </mbean>


              • 4. Re: Multiple Destination Mgr and Pesistence Managers
                Dimitris Kakkos Newbie

                hi,

                Following your instructions, I am trying to configure the additional null-persistance manager.

                I have sucessfully create my local queue but when i am trying to connect from my application it fails:

                2006-11-09 19:37:07,925 ERROR [org.jboss.ejb.plugins.jms.JMSContainerInvoker] Re
                connect failed: JMS provider failure detected for LoggingEventHandler
                org.jboss.deployment.DeploymentException: Error during queue setup; - nested thr
                owable: (javax.jms.InvalidDestinationException: The destination QUEUE.LoggingEve
                ntQueue does not exist !)
                at org.jboss.deployment.DeploymentException.rethrowAsDeploymentException
                (DeploymentException.java:53)
                at org.jboss.ejb.plugins.jms.JMSContainerInvoker.innerStartDelivery(JMSC
                ontainerInvoker.java:811)
                at org.jboss.ejb.plugins.jms.JMSContainerInvoker$ExceptionListenerImpl$E
                xceptionListenerRunnable.run(JMSContainerInvoker.java:1419)
                at java.lang.Thread.run(Thread.java:595)
                Caused by: javax.jms.InvalidDestinationException: The destination QUEUE.LoggingE
                ventQueue does not exist !
                at org.jboss.mq.server.ClientConsumer.addSubscription(ClientConsumer.jav
                a:140)
                at org.jboss.mq.server.JMSDestinationManager.subscribe(JMSDestinationMan
                ager.java:572)
                at org.jboss.mq.server.JMSServerInterceptorSupport.subscribe(JMSServerIn
                terceptorSupport.java:171)
                at org.jboss.mq.security.ServerSecurityInterceptor.subscribe(ServerSecur
                ityInterceptor.java:157)
                at org.jboss.mq.server.TracingInterceptor.subscribe(TracingInterceptor.j
                ava:643)
                at org.jboss.mq.server.JMSServerInvoker.subscribe(JMSServerInvoker.java:
                177)
                at org.jboss.mq.il.uil2.ServerSocketManagerHandler.handleMsg(ServerSocke
                tManagerHandler.java:185)
                at org.jboss.mq.il.uil2.SocketManager$ReadTask.handleMsg(SocketManager.j
                ava:395)
                at org.jboss.mq.il.uil2.msgs.BaseMsg.run(BaseMsg.java:398)
                at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExec
                utor.java:748)
                ... 1 more
                2006-11-09 19:37:07,927 INFO [org.jboss.ejb.plugins.jms.JMSContainerInvoker] Wa
                iting for reconnect internal 10000ms for LoggingEventHandler

                Is there something additional that is not mentioned in your post?

                • 5. Re: Multiple Destination Mgr and Pesistence Managers
                  Jan Geysen Newbie

                  any solution found already ?

                  I have facing the same problem (different persistency schemes for destinations)

                  br

                  • 6. Re: Multiple Destination Mgr and Pesistence Managers
                    Vincent Tran Newbie

                    I am having some difficulties regarding this as well.

                    Basically now that I have my own Invoker, I need to add a new InvocationLayer to jvm-il-service.xml to call my Invoker. I believe this means I need to create my own ConnectionFactory and XAConnectionFactory that the new InvocationLayer is bound to.

                    Does anyone know if it is possible to create a new ConnectionFactory/XAConnectionFactory for JBossMQ? and how? I found some sample xml in JBoss Messaging docs but that doesn't seem to work.

                    • 8. Re: Multiple Destination Mgr and Pesistence Managers
                      Vincent Tran Newbie

                      I figured it out. I was right, you do need to create your own ConnectionFactory.

                      Example on how:


                      UserTopicConnectionFactory
                      UserConnectionFactory
                      java:/UserJmsXA
                      jboss:service=Naming


                      After ward, you should look in jms-ds.xml and copy the mbeans in there as well.

                      • 9. Re: Multiple Destination Mgr and Pesistence Managers
                        Vincent Tran Newbie

                        Here is the code, before the sample code didn't show properly.

                        <mbean code="org.jboss.naming.LinkRefPairService"
                         name="jboss.jms:alias=UserConnectionFactory">
                         <attribute name="JndiName">UserTopicConnectionFactory</attribute>
                         <attribute name="RemoteJndiName">UserConnectionFactory</attribute>
                         <attribute name="LocalJndiName">java:/UserJmsXA</attribute>
                         <depends>jboss:service=Naming</depends>
                         </mbean>