-
1. Re: Topics with AS7 and HornetQ
jmesnil Jun 1, 2012 12:09 PM (in response to lauradp)do you have a subscriber listening on the topic?
If there are no consumer connected (or durable subscribers), HornetQ will discard the messages sent to the topic (since nobody is interested by them).
-
2. Re: Topics with AS7 and HornetQ
jbertram Jun 1, 2012 12:41 PM (in response to lauradp)1 of 1 people found this helpfulYour code looks fine as far as I can tell. Although you should try to use ConnectionFactory, Session, Destination, and MessageProducer rather than TopicConnectionFactory, TopicSession, Topic, and TopicPublisher respectively since that is the recommendation from the JMS spec.
Jeff is right. This is basic JMS semantics with topics.
Try using a queue rather than a topic.
-
3. Re: Topics with AS7 and HornetQ
clebert.suconic Jun 1, 2012 11:38 PM (in response to jbertram)TopicConnection and QueueConnection are obsolete interfaces. try to use the unified ones.
-
4. Re: Topics with AS7 and HornetQ
lauradp Jun 4, 2012 3:43 AM (in response to lauradp)Thanks for your answers!
I was trying to develop an example about queues and one about topics in HORNETQ.That's why I used topics instead of queues.
What's is the unified interface??
Thanks
Laura
-
5. Re: Topics with AS7 and HornetQ
jbertram Jun 4, 2012 10:20 AM (in response to lauradp)1 of 1 people found this helpfulUsing a topic is fine as long as you understand the basic semantics (i.e. if there are no subscriptions any message sent to the topic will be discarded).
The "unified" interfaces are the ones I referred to in my previous comment. To be clear, these are unified:
- ConnectionFactory
- Session
- Destination
- MessageProducer
These are not unified:
- QueueConnectionFactory, TopicConnectionFactory
- QueueSession, TopicSession
- Queue, Topic
- QueueSender, TopicPublisher
-
6. Re: Topics with AS7 and HornetQ
lauradp Jun 4, 2012 10:24 AM (in response to jbertram)Thank you Justin,
so you are suggesting me to always use the unified interfaces and to let "ebj-jar.xml" file to specify the destination type. Isn't it?
thanks
Laura
-
7. Re: Topics with AS7 and HornetQ
jbertram Jun 4, 2012 10:31 AM (in response to lauradp)I am suggesting that you use the unified interfaces, but I'm not sure where ejb-jar.xml enters your use-case. You haven't mentioned it until now. It shouldn't be related at all to how messages are produced. In terms of messaging, It only controls the behavior of an MDBs consumption of a message.
-
8. Re: Topics with AS7 and HornetQ
lauradp Jun 4, 2012 10:33 AM (in response to jbertram)ok, thanks
Laura