6
votes

I know that JMS Queues can be created in HornetQ via the hornetq-jmx.xml Configuration file. But I want to do this from the client?

I tried:

HornetQJMSClient.createQueue(queueName);

but this seems to not create the queue (on the hornetq server)? I always get an exception that the queue is unknown when I try to create a consumer for this queue.

I would be very thankfull for advice how to create JMS Queues from the client. (I do not Want to use JNDI at all, neither on the client nor on the server, if possible).

Update:

I would not mind using any of HornetQs Core APIs (as opposed to the JMS APis) to create the queues from the client. My question is: Is there any way to create queues from the client (either with JMS Apis or with the HornetQ Core APIs).

3

3 Answers

2
votes

You can use the management API to create queues.

In a future version (probably 2.3.0) session.createQueue and createTopic are going to create the physical queues as well (as long as you have authorization of course).

2
votes

You don't... It needs that you specify in it's configuration files the Queues's names (JMS or Core queues).

Even though the name implies it, you don't 'create' the queue when you call createQueue() method, you just do a lookup and register it on your client side to use it (so it checks if it exists or not).

The closest you'll get from it is creating Temporary Queues, usually when you implement a Request-Response behavior.

1
votes

This might be of a little help for queue creation using core APIs: http://community.jboss.org/message/624481