File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes EJB and other Java EE Technologies and the fly likes pub/sub issues Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "pub/sub issues" Watch "pub/sub issues" New topic

pub/sub issues

Dm Laf

Joined: Mar 23, 2004
Posts: 10
Is the subscriber using the message listener, when a message is published, to receive the message and remove it from the topic.
Will the subscriber be able to receive another message from a publisher on the same topic.
At the moment i have developed an mdb,publisher and subscriber and i receive only the first message without any listener whatsoever.
However if i add the following line: subscriber.setMessageListener(this); i get the following exception: javax.jms.JMSException: A message listener is already registered. My class implements MessageListener and onMessage method.
Any ideas?
Lasse Koskela

Joined: Jan 23, 2002
Posts: 11962
When you try to register "this" as a MessageListener, which object is "this" pointing to?

Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
Pinda Ros
Ranch Hand

Joined: Apr 14, 2003
Posts: 65
"this" obviously point to the current object, which i guess it implements MessageListener and has a method onMessage... implemented etc etc
for more info

NanoAgent is an Artificial intelligence RoBot of microscopic proportions built by means of nanotechnology
I agree. Here's the link:
subject: pub/sub issues
It's not a secret anymore!