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);
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,
can't say whats wrong with your first example, its probably a config issue, regarding the second, A core queue is not a jms queue, to make a jms queue use one of the jms management API's. All this is in the management section of the user manual and available methods are in the javadocs