1 Reply Latest reply on Apr 12, 2011 2:38 AM by Andy Taylor

    create new queue via Core API

    Denis Toporov Newbie

      Hello,

       

      I'm quite new to hornetq spent couple of days googling / documentation and examples browsing but still didnt get clear answer how to create new hornetq queue at runtime using all 3 API (actually I was able to create new queue at runtime via JMX)

       

      Core API example: this one is hangs  at  requestor.request() line if I dont provide timeout, otherwise returned message is null.

       

              TransportConfiguration transportConfiguration = new TransportConfiguration(NettyConnectorFactory.class.getName());

              ServerLocator locator = HornetQClient.createServerLocatorWithoutHA(transportConfiguration);

              ClientSessionFactory factory = locator.createSessionFactory();

              ClientSession coreSession = factory.createSession(false, false, false);

              ClientRequestor requestor = new ClientRequestor(coreSession, "jms.queue.hornetq.management");

              ClientMessage clientMessage = coreSession.createMessage(false);

              ManagementHelper.putOperationInvocation(clientMessage, "jms.server", "createQueue", "coreTestQueue");

              ClientMessage reply =requestor.request(clientMessage);       

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

       

      And if I try to use:

       

               coreSession.createQueue(queueName, queueName, true);

               this one creates only CORE queue without JMS queue.

       

      I would appreaciate help on this, since I'm stuck here,

       

       

      regards,

      denis