5 Replies Latest reply on Dec 1, 2005 8:10 AM by nzmalik

    Multiple instances of DestinationManager, PersistenceManager

    nzmalik

      I am attempting to setup a new DestinationManager, PersistenceManager, and MessageCache to allow me to handle persistence of different queues in the same JBoss server differently.

      I need to be able to setup some queues as non-persistent AND setup the cache such that if a message was going to be cached/persisted that it should be dropped from memory instead. I have implemented all classes that I need to successfully do this (I haven't tested it yet), but am unable to get queues to use this new DestinationManager successfully if the standard jboss.mq:service=DestinationManager exists. I have changed that service to point to my new service and it works if it is the only DestinationManager, etc. in existance.

      Is it possible to have a second one setup? Because, if so, I cannot figure out how to configure it successfully. Here's my new null-persistence-service.xml (basically):

      Code:

      <?xml version="1.0" encoding="UTF-8"?>
      
      <server>
      
       <mbean code="org.jboss.mq.pm.none.PersistenceManager"
       name="MyCompany.mq:service=PersistenceManager">
       </mbean>
      
       <mbean code="com.MyCompany.mq.pm.CacheStore"
       name="MyCompany.mq:service=CacheStore">
       </mbean>
      
       <mbean code="org.jboss.mq.server.MessageCache"
       name="jboss.mq:service=MessageCache">
       <attribute name="HighMemoryMark">50</attribute>
       <attribute name="MaxMemoryMark">60</attribute>
       <attribute name="CacheStore">MyCompany.mq:service=CacheStore</attribute>
       </mbean>
      
       <mbean code="org.jboss.mq.server.jmx.DestinationManager"
       name="MyCompany.mq:service=DestinationManager">
       <depends optional-attribute-name="MessageCache">MyCompany.mq:service=MessageCache</depends>
       <depends optional-attribute-name="PersistenceManager">MyCompany.mq:service=PersistenceManager</depends>
       <depends optional-attribute-name="StateManager">jboss.mq:service=StateManager</depends>
       </mbean>
      
      </server>
      




      And the service containing my queue:

      Code:
      <?xml version="1.0" encoding="UTF-8"?>
      
      <server>
      
       <mbean code="org.jboss.mq.server.jmx.Queue"
       name="jboss.mq.destination:service=Queue,name=MyQueue">
       <depends optional-attribute-name="DestinationManager">MyCompany.mq:service=DestinationManager</depends>
       </mbean>
      
      </server>
      




      Thanks for the help.

      (Cross posted in "Installation & Configuration". Sorry...)

        • 1. Re: Multiple instances of DestinationManager, PersistenceMan
          genman


          What happens when you turn on JBoss? Does it blow up or something? How do you know it is working or not?

          • 2. Re: Multiple instances of DestinationManager, PersistenceMan
            nzmalik

            JBoss is not blowing up when started. The issue is only apparent when I attempt to connect to a queue using the new destination manager. The client's exception is:

            javax.jms.InvalidDestinationException: This destination does not exist! QUEUE.client-send
             at org.jboss.mq.server.JMSDestinationManager.addMessage(JMSDestinationManager.java:394)
             at org.jboss.mq.server.JMSDestinationManager.addMessage(JMSDestinationManager.java:378)
             at org.jboss.mq.server.JMSServerInterceptorSupport.addMessage(JMSServerInterceptorSupport.java:136)
             at org.jboss.mq.security.ServerSecurityInterceptor.addMessage(ServerSecurityInterceptor.java:153)
             at org.jboss.mq.server.TracingInterceptor.addMessage(TracingInterceptor.java:270)
             at org.jboss.mq.server.JMSServerInvoker.addMessage(JMSServerInvoker.java:136)
             at org.jboss.mq.il.uil2.ServerSocketManagerHandler.handleMsg(ServerSocketManagerHandler.java:86)
             at org.jboss.mq.il.uil2.SocketManager$ReadTask.handleMsg(SocketManager.java:356)
             at org.jboss.mq.il.uil2.msgs.BaseMsg.run(BaseMsg.java:377)
             at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:748)
             at java.lang.Thread.run(Thread.java:534)
            


            There are no exceptions shown on the server's console or in the server.log file. The jmx-console shows this queue is started correctly and that the DestinationManager is set to my new service.

            • 3. Re: Multiple instances of DestinationManager, PersistenceMan
              nzmalik

              Haven't tried yet, but think this thread might have the answer to my question:

              Multiple Destination Mgr and Pesistence Managers

              If correct, I wasn't setting the Invoker correctly in my configuration.

              • 4. Re: Multiple instances of DestinationManager, PersistenceMan
                sharadjain

                Your MessageCache MBean has wrong name: should be MyCompany.mq:service=MessageCache instead of jboss.mq:service=MessageCache.

                • 5. Re: Multiple instances of DestinationManager, PersistenceMan
                  nzmalik

                  I've moved away from needing this solution to work, but I will try correcting the message cache name if I have a chance in the future.