Hello Team,

I have a problem while Creating MessageConsumer with MessageListener. I have
uploaded the files. The problem is here. 

*Requirement*

I want to have multiple Publishers/Producers and only one
Subscriber/Consumer listening to all the Publishers. Each time a message is
published it should be picked up by the subscriber. Only the latest message
should be picked up by the subscriber. Not the previous messages.

*Problem*


1) My MessageConsumer listens to a Queue called "Terminal1". When I post a
Message 1st time the MessageListener picks up the message and displays it.
When I post a 2nd message message to the queue it displays both the messages
inside MessageListener(including the 1st message), it happens for the 3rd
message. It happens for the further messages too.

2) I want the MessageListener to pick up only my last sent message, not all
the previous messages.

3) I guess all the messages are picked up from "Messages Enqueued". When the
MessageConsumer is alive all the messages posted in the queue are picked up
by the MessageListener. I don't want this.

Is there a way to tell the MessageConsumer(MessageListener) just to pick up
only the last message?


1) When  http://activemq.2283324.n4.nabble.com/file/n4656142/TestMsg.java
TestMsg.java 
http://activemq.2283324.n4.nabble.com/file/n4656142/TestLogger.java
TestLogger.java 
http://activemq.2283324.n4.nabble.com/file/n4656142/ObjectMessageListener.java
ObjectMessageListener.java 







--
View this message in context: 
http://activemq.2283324.n4.nabble.com/ACTIVEMQ-Consumer-MessageListener-returning-Multiple-messages-including-Earlier-Messages-returning-tp4656142.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Reply via email to