-
1. Stomp - Migrating from ActiveMQ
clebert.suconic Feb 23, 2011 5:28 PM (in response to peteredhead)Take a look at the docs. The topic has a special name for the Address name.
-
2. Re: Stomp - Migrating from ActiveMQ
peteredhead Feb 24, 2011 5:05 AM (in response to clebert.suconic)Thanks for the reply.
I used the docs initally to make the changes to the hornet-configuration.xml file.
First I added the Stomp acceptor:
<acceptor name="stomp-acceptor"> <factory-class>org.hornetq.core.remoting.impl.netty.NettyAcceptorFactory</factory-class> <param key="protocol" value="stomp" /> <param key="use-nio" value="true" /> <param key="host" value="0.0.0.0" /> <param key="port" value="61613" /> </acceptor>
Initially I tried adding the topics to the hornet-jms file, but always received a topic does not exist error.
Next I tried moving the topics to the hornet-configuration.xml file, but that caused an error on startup. It appears the <topics> tag is not recognised.
<topics> <topic name="test"> <address>/topic/test</address> </topic> </topics>
Next I tried putting the topic in a <queues> tag, which stopped the error on startup, but I still could not subscribe to the topic.
<queues> <topic name="test"> <address>/topic/test</address> </topic> </queues>
Whatever I try, I always get the error:
received an error HornetQException[errorCode=100 message=Queue /topic/test does not exist]
Is there anywhere else in the docs (other than
http://hornetq.sourceforge.net/docs/hornetq-2.1.2.Final/user-manual/en/html/interoperability.html ) that I can get more information from?
Thanks,
Pete
-
3. Stomp - Migrating from ActiveMQ
clebert.suconic Feb 24, 2011 9:39 AM (in response to peteredhead)There are the examples on stomp also.. did you look at them?
-
4. Stomp - Migrating from ActiveMQ
peteredhead Feb 24, 2011 11:27 AM (in response to clebert.suconic)Clebert Suconic wrote:
There are the examples on stomp also.. did you look at them?
Yes, but I was unable to set up the topics and subscribe to them, using the topic structure I require.
-
5. Re: Stomp - Migrating from ActiveMQ
reid Feb 25, 2011 8:20 PM (in response to peteredhead)1 of 1 people found this helpfulHi Pete,
HornetQ has moved on from the previous concept of Topics and Subscriptions. It uses a newer model that started (as far as I know) with AMQP where you have Addresses and Queues. Rather than subscribing to a topic, HornetQ allows a producer to write to an Address. Consumers read from Queues.
Messages are routed to Queues through Addresses. To select which messages you want to receive (subscribe), one uses filters on the address.
This is a substantial shift, but introduces substantial power. For example, we are no longer limited to a simple topic, but can now filter messages on any property on the message.
I work primarily on JRuby (Ruby on the Java VM) and used to use the JMS API for all messaging. I have since moved to the HornetQ Core API due to the above more powerful features. https://github.com/ClarityServices/jruby-hornetq
I looked at the source code for the Stomp protocol implementation and it uses the Core API, so it looks like it follows the newer Address, Queue, Filter approach as opposed to the JMS Pub Sub mechanism. I am going to spend more time reading the HornetQ Stomp source code, so will update this post should I find anything different.
ActiveMQ only exposes a JMS API, with HornetQ's use of the Core API for Stomp, none of the JMS configurations apply to the Stomp interface. Look rather at configuring Addresses, Queues and Filters for the Core API and therefore Stomp.
We have started using the Stomp protocol to integrate with Go Language clients. HornetQ is fast and reliable, so very well worth the move.
Enjoy!
Reid