wood burning stoves 2.0*
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


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "pub/sub issues" Watch "pub/sub issues" New topic
Author

pub/sub issues

Dm Laf
Greenhorn

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
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
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
view
here
for more info


NanoAgent is an Artificial intelligence RoBot of microscopic proportions built by means of nanotechnology
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: pub/sub issues
 
Similar Threads
Persisting messages in JMS
Durable Subscriber Problem
Publishing the message serially to the listener
Durable Subscriber Problem
jms pub sub