1 Reply Latest reply on Apr 12, 2011 11:51 AM by d3ni5

    jndi binding for queue created via JMS

    d3ni5

      Hello,

       

      I created new queue via JMS management API but this queue is not binded to jndi, how it can be binded to jndi ?

       

      code example:

       

              Context context = new InitialContext(getEnv());

              QueueConnectionFactory connectionFactory = (QueueConnectionFactory) context.lookup("/ConnectionFactory");

              QueueConnection connection = connectionFactory.createQueueConnection();

              Queue managementQueue = HornetQJMSClient.createQueue("hornetq.management");

              QueueSession session = (QueueSession) connection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);

              connection.start();

              Message m = session.createMessage();

              JMSManagementHelper.putOperationInvocation(m, "jms.server", "createQueue", "jms.queue.coreTestQueueJMS", "queueJndiName" );

              QueueRequestor requestor = new QueueRequestor(session, managementQueue);

              Message reply = requestor.request(m);

              System.out.println(JMSManagementHelper.hasOperationSucceeded(reply));

       

      regards,

      denis

        • 1. jndi binding for queue created via JMS
          d3ni5

          looks like i resolved it, it appears that the queue "jms.queue.coreTestQueueJMS" existed without jndiBinding at the moment I attempted to create it.

          After I destroyed this queue and created with  :

           

          boolean          createQueue(String name, String jndiBindings)

           

          e.g.

           

            JMSManagementHelper.putOperationInvocation(m, "jms.server", "createQueue", "jms.queue.coreTestQueueJMS", "queueJndiName" );

           

          this  "queueJndiName" was deployed to JNDI

           

          regards,

          denis