activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From benstillerjohn <>
Subject ACTIVEMQ Consumer(MessageListener) returning Multiple messages(including Earlier Messages) returning...
Date Fri, 07 Sep 2012 10:09:29 GMT
Hello Team,

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


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.


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 

View this message in context:
Sent from the ActiveMQ - User mailing list archive at

View raw message