You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by anujjain <an...@gmail.com> on 2009/01/12 07:27:54 UTC

unable to create non durable consumer

Hi I am using ActiveMQ 5.2.0 with NMS ver 1.1. I am trying to create a non
durable consumer as below:
=============
this.consumer = this.session.CreateConsumer(topic);
=============
Whenever a message is published on that topic, and if I have no subscription
to this topic. Message is persisted. And whenever i subscribe to that topic
i get all the messages published before my subscription. Further to this I
have also set the persistent property of my producer as well as
NMSPersistent property on my producer and my message as false.
====================
this.producer.Persistent = false;
textMessage.NMSPersistent = false;
====================
But even then it is creating a durable consumer. Can anyone suggest me
wether I am missing any thing?
-- 
View this message in context: http://www.nabble.com/unable-to-create-non-durable-consumer-tp21409108p21409108.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: unable to create non durable consumer

Posted by Jim Gomes <e....@gmail.com>.
I think a couple of things should be clarified first.  Setting the
Persistent flag is not the same thing as a Durable Consumer.  A durable
consumer must be created with the CreateDurableConsumer() API.  A normal
consumer will consume messages flagged as persistent as well as
non-persistent.

If you are creating and publishing to a topic, and not a queue, any messages
published to the topic before the consumer is created should not be
delivered to that consumer.  However, if you are publishing messages to a
queue, then a consumer that is attached to the queue later on will have
those messages delivered to it.

A test case showing the problem would be helpful.

Best,
Jim

On Sun, Jan 11, 2009 at 10:27 PM, anujjain <an...@gmail.com> wrote:

>
> Hi I am using ActiveMQ 5.2.0 with NMS ver 1.1. I am trying to create a non
> durable consumer as below:
> =============
> this.consumer = this.session.CreateConsumer(topic);
> =============
> Whenever a message is published on that topic, and if I have no
> subscription
> to this topic. Message is persisted. And whenever i subscribe to that topic
> i get all the messages published before my subscription. Further to this I
> have also set the persistent property of my producer as well as
> NMSPersistent property on my producer and my message as false.
> ====================
> this.producer.Persistent = false;
> textMessage.NMSPersistent = false;
> ====================
> But even then it is creating a durable consumer. Can anyone suggest me
> wether I am missing any thing?
> --
> View this message in context:
> http://www.nabble.com/unable-to-create-non-durable-consumer-tp21409108p21409108.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>
>