activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Keith Irwin" <>
Subject when is a delivered message delivered?
Date Wed, 10 May 2006 22:14:54 GMT

I've got a bunch of client processes which listen on some topics, send
to others.  When I take one of the clients down, then start it back
up, I suddenly get a bunch of messages I've already seen.  Even though
I use durable subscriptions and persistent messages, this shouldn't be
so, should it?


For the topics listened to, I use a durable subscription, something like this:

 ... // listening

   String topicName = "bar";
   String listenerName = "foo";
   String clientId = "";
   String subscriberName = "";

   this.connect = factory.createTopicConnection();
   this.session = connect.createTopicSession(false,
   this.subscriber = session.createDurableSubscriber(this.topic,


--- // sending init

  this.connect = factory.createTopicConnection();
  this.session = connect.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
  this.topic = (Topic)jndi.lookup(this.topicName);
  this.publisher = this.session.createPublisher(this.topic);

--- // sending

   TextMessage textMessage = this.session.createTextMessage();
   testMessage.setStringProperty("something", "other");


And so on and so on. Basically, I use a client name + the topic name
as a "unique" client id and a unique subscriber name.

So far so good.  All of this worked with OpenJMS as I'd expect (except
I had to write my own failover stuff in case openjms went down).

When I run a test, everything works exactly as I expect it should.

BUT, if I take out one of the components, then start it up again, that
component gets a bunch of messages it's already seen!

ALSO, if I shut down activemq itself, then start it back up again, a
bunch of messages get, as far as I can tell, resent!

Why is this so?  I'd expect that if all messages are delivered and I
take down a client component to, say, install a new version, I should
be able to bring it up without it getting a slew of new messages.

Has anyone else seen this?  Perhaps a teensy little setting or api fixes this?


View raw message