4 Replies Latest reply on Aug 1, 2006 4:34 AM by Maciek

    dynamic create queue

    Maciek Newbie

      Hi

      It's possible to dymaic create queue in my code and than assign MDBean to it ?

      I don't konow how to get access to ServerPeer i my code.

      Thanks for any hints.

        • 1. Re: dynamic create queue
          Ovidiu Feodorov Master

          Use ServerPeer's "createQueue" JMX method. It will create a queue (and the associated MBean) for you.

          ServerPeer is an MBean. It can be programatically accessed as any other MBean.

          • 2. Re: dynamic create queue
            Maciek Newbie

            I'am trying to use

            MBeanProxyExt.create(....), but I don't know which interface use for ServerPeer service

            • 3. Re: dynamic create queue
              Tim Fox Master

              This explains how to call an MBean:

              http://wiki.jboss.org/wiki/Wiki.jsp?page=HowDoIGetRemoteAccessToMyMBean

              The ServerPeer object name can be found by looking at the jmx-console where all the MBeans are listed (jboss.messaging:service=ServerPeer).

              You can also find this out by looking a the serverpeer MBean config in messaging-service.xml:

              
              <mbean code="org.jboss.jms.server.ServerPeer"
               name="jboss.messaging:service=ServerPeer"
               xmbean-dd="xmdesc/ServerPeer-xmbean.xml">
              
               <constructor>
               <!-- ServerPeerID -->
               <arg type="java.lang.String" value="server.0" />
               <!-- DefaultQueueJNDIContext -->
               <arg type="java.lang.String" value="/queue" />
               <!-- DefaultTopicJNDIContext -->
               <arg type="java.lang.String" value="/topic" />
               </constructor>
              
               <depends optional-attribute-name="PersistenceManager">jboss.messaging:service=PersistenceManager</depends>
               <depends optional-attribute-name="MessageStore">jboss.messaging:service=MessageStore</depends>
               <depends optional-attribute-name="ChannelMapper">jboss.messaging:service=ChannelMapper</depends>
              
               <!-- Set to -1 to completely disable client leasing -->
               <attribute name="SecurityDomain">java:/jaas/messaging</attribute>
               <attribute name="DefaultSecurityConfig">
               <security>
               <role name="guest" read="true" write="true" create="true"/>
               </security>
               </attribute>
               </mbean>
              
              
              






              • 4. Re: dynamic create queue
                Maciek Newbie

                Well I followed this way and it works

                Tahnks