JBoss.orgCommunity Documentation

Chapter 9. Creating Destinations

You can create a durable queue or topic through the REST interface. Currently you cannot create a temporary queue or topic. To create a queue you do a POST to the relative URL /queues with an XML representation of the queue. The XML syntax is the same queue syntax that you would specify in hornetq-jms.xml if you were creating a queue there. For example:

POST /queues
 Host: example.com
 Content-Type: application/hornetq.jms.queue+xml

 <queue name="testQueue">

 --- Response ---
 HTTP/1.1 201 Created
 Location: http://example.com/queues/jms.queue.testQueue

Notice that the Content-Type is application/hornetq.jms.queue+xml.

Here's what creating a topic would look like:

POST /topics
 Host: example.com
 Content-Type: application/hornetq.jms.topic+xml

 <topic name="testTopic">

 --- Response ---
 HTTP/1.1 201 Created
 Location: http://example.com/topics/jms.topic.testTopic