Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How does one programmatically create a topic w/ hornet q?

Tags:

jms

jboss

hornetq

I have been looking at the org.hornetq.core.server package which seems to have the most interesting low level APIS relating to managing the server.

The server session has a few methods labelled something Queue but none include Topic ...

ServerSession

void createQueue(SimpleString address,
                          SimpleString name,
                          SimpleString filterString,
                          boolean temporary,
                          boolean durable) throws Exception;

   void deleteQueue(SimpleString name) throws Exception

interface QueueFactory

Queue createQueue(long persistenceID,
                 final SimpleString address,
                 SimpleString name,
                 Filter filter,
                 boolean durable,
                 boolean temporary);

However i could not figure out how to create a topic. Am i missing something is a JMS topic implemented as a queue ?

like image 867
mP. Avatar asked Dec 05 '25 10:12

mP.


1 Answers

The core API does not know the concept of a Topic as it is used in JMS, it only knows queues and adresses. In the documentation it says:

*For example, a JMS topic would be implemented by a single address to which many queues are bound. Each queue represents a subscription of the topic. A JMS Queue would be implemented as a single address to which one queue is bound - that queue represents the JMS queue.*

You could implement it with the core API the same way or just use JMS :-)

like image 180
roundrobin Avatar answered Dec 07 '25 15:12

roundrobin



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!