You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by Arif Mohd <ar...@wipro.com> on 2007/06/13 12:54:57 UTC

Messages from the topic are not being deleted once they are consume

Hi,

   Could any body knows why messages from a topic are not removed once they
are subsribed

  Iam using activemq 4.1 and servicemix 3.1
  Iam using durable topic to store the messages and clients will read this
messages by using message selectors.
-- 
View this message in context: http://www.nabble.com/Messages-from-the-topic-are-not-being-deleted-once-they-are-consume-tf3913879s12049.html#a11096928
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: Messages from the topic are not being deleted once they are consume

Posted by Arif Mohd <ar...@wipro.com>.
Also my client program is posted, please have a look into the thread

http://www.nabble.com/servicemix-Hanging-tf3899807s12049.html#a11114043


Arif Mohd wrote:
> 
> Hi bsynder,
> 
>     - The consumer count is 1 and DequeueCount, DispatchCount are same
>     - If i see the messages using browseMessages all the messages are
> there though they are read by the one and only one cosumer
>     
> 
> bsnyder wrote:
>> 
>> On 6/13/07, Arif Mohd <ar...@wipro.com> wrote:
>>>
>>> Hi,
>>>
>>>    Could any body knows why messages from a topic are not removed once
>>> they
>>> are subsribed
>>>
>>>   Iam using activemq 4.1 and servicemix 3.1
>>>   Iam using durable topic to store the messages and clients will read
>>> this
>>> messages by using message selectors.
>> 
>> Have you tried using jconsole to look at the queue to see what the
>> ConsumerCount, DispatchCount and DequeueCount variables are?
>> 
>> Bruce
>> -- 
>> perl -e 'print
>> unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
>> );'
>> 
>> Apache Geronimo - http://geronimo.apache.org/
>> Apache ActiveMQ - http://activemq.org/
>> Apache ServiceMix - http://servicemix.org/
>> Castor - http://castor.org/
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Messages-from-the-topic-are-not-being-deleted-once-they-are-consume-tf3913879s12049.html#a11114088
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: Messages from the topic are not being deleted once they are consume

Posted by Arif Mohd <ar...@wipro.com>.
Hi bsynder,

    - The consumer count is 1 and DequeueCount, DispatchCount are same
    - If i see the messages using browseMessages all the messages are there
though they are read by the one and only one cosumer
    

bsnyder wrote:
> 
> On 6/13/07, Arif Mohd <ar...@wipro.com> wrote:
>>
>> Hi,
>>
>>    Could any body knows why messages from a topic are not removed once
>> they
>> are subsribed
>>
>>   Iam using activemq 4.1 and servicemix 3.1
>>   Iam using durable topic to store the messages and clients will read
>> this
>> messages by using message selectors.
> 
> Have you tried using jconsole to look at the queue to see what the
> ConsumerCount, DispatchCount and DequeueCount variables are?
> 
> Bruce
> -- 
> perl -e 'print
> unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
> );'
> 
> Apache Geronimo - http://geronimo.apache.org/
> Apache ActiveMQ - http://activemq.org/
> Apache ServiceMix - http://servicemix.org/
> Castor - http://castor.org/
> 
> 

-- 
View this message in context: http://www.nabble.com/Messages-from-the-topic-are-not-being-deleted-once-they-are-consume-tf3913879s12049.html#a11113884
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: Messages from the topic are not being deleted once they are consume

Posted by Bruce Snyder <br...@gmail.com>.
On 6/13/07, Arif Mohd <ar...@wipro.com> wrote:
>
> Hi,
>
>    Could any body knows why messages from a topic are not removed once they
> are subsribed
>
>   Iam using activemq 4.1 and servicemix 3.1
>   Iam using durable topic to store the messages and clients will read this
> messages by using message selectors.

Have you tried using jconsole to look at the queue to see what the
ConsumerCount, DispatchCount and DequeueCount variables are?

Bruce
-- 
perl -e 'print unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
);'

Apache Geronimo - http://geronimo.apache.org/
Apache ActiveMQ - http://activemq.org/
Apache ServiceMix - http://servicemix.org/
Castor - http://castor.org/

Re: Messages from the topic are not being deleted once they are consume

Posted by James Strachan <ja...@gmail.com>.
On 6/14/07, Arif Mohd <ar...@wipro.com> wrote:
>
> What i mean to say is if the messages which are already read by the
> client(for topic) are shown in the jconsole means some where it might be
> storing in memory
>
>      If the above case is correct then it will eat away the heap memory and
> it might be the cause for hanging of servicemix
>     Am i correct?

Messages are often kept around until they are ack'd. Though with 5.x
it shouldn't be holding on to messages indefinitely as they can be
spooled to disk (for non-persistent) or evicted from RAM (for
persistent)
-- 
James
-------
http://macstrac.blogspot.com/

Re: Messages from the topic are not being deleted once they are consume

Posted by Arif Mohd <ar...@wipro.com>.
What i mean to say is if the messages which are already read by the
client(for topic) are shown in the jconsole means some where it might be
storing in memory

     If the above case is correct then it will eat away the heap memory and
it might be the cause for hanging of servicemix
    Am i correct?


Arif Mohd wrote:
> 
> But if i browse for the messages of a queue then i will not find the
> messages which are already read by a client
> 
>    Is this a bug with jconsole(for topics)
> 
>      
> 
> James.Strachan wrote:
>> 
>> On 6/14/07, Arif Mohd <ar...@wipro.com> wrote:
>>>
>>> Hi James,
>>>     Iam not recieving any duplicate message when i restart my client for
>>> the
>>> next time with same clientid,subscirption name, it is fine till this
>>> point.
>>>
>>>   But if i open jconsole, select the topic name say "topic1" under
>>> operations tab, if i click on browseMessages it is showing all the
>>> messages
>>>
>>>    what my understanding is the jconsole shouldn't show the messages
>>> which
>>> are already read,  some times if i click on browse messages button i
>>> will
>>> get alert saying OutOfMemory(due to huge messages which are already
>>> read)
>>>
>>>     From the above observation from jconsole iam assuming that the
>>> messages
>>> are not deleted from topic once they are read.Is my undersanding wrong?
>>>
>>>     Please suggest me in this regard.
>> 
>> I"m not sure. To be honest the idea of browsing messages on a topic
>> via JMX is kinda bogus anyway. Browsing pending messages for a
>> specific consumer, fair enough (particularly for a durable
>> subscriber), but I don't have much of a clue what that code does or
>> why I'm afraid.
>> 
>> -- 
>> James
>> -------
>> http://macstrac.blogspot.com/
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Messages-from-the-topic-are-not-being-deleted-once-they-are-consume-tf3913879s12049.html#a11118010
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: Messages from the topic are not being deleted once they are consume

Posted by James Strachan <ja...@gmail.com>.
On 6/14/07, Arif Mohd <ar...@wipro.com> wrote:
>
> But if i browse for the messages of a queue then i will not find the messages
> which are already read by a client
>
>    Is this a bug with jconsole(for topics)

Browsing queues is a well defined operation; browsing queues shows the
messages on the queue which have not been processed by consumers.

Am not sure what browsing topics actually means (i.e. I don't
understand what the code does or what it really means).

-- 
James
-------
http://macstrac.blogspot.com/

Re: Messages from the topic are not being deleted once they are consume

Posted by Arif Mohd <ar...@wipro.com>.
But if i browse for the messages of a queue then i will not find the messages
which are already read by a client

   Is this a bug with jconsole(for topics)

     

James.Strachan wrote:
> 
> On 6/14/07, Arif Mohd <ar...@wipro.com> wrote:
>>
>> Hi James,
>>     Iam not recieving any duplicate message when i restart my client for
>> the
>> next time with same clientid,subscirption name, it is fine till this
>> point.
>>
>>   But if i open jconsole, select the topic name say "topic1" under
>> operations tab, if i click on browseMessages it is showing all the
>> messages
>>
>>    what my understanding is the jconsole shouldn't show the messages
>> which
>> are already read,  some times if i click on browse messages button i will
>> get alert saying OutOfMemory(due to huge messages which are already read)
>>
>>     From the above observation from jconsole iam assuming that the
>> messages
>> are not deleted from topic once they are read.Is my undersanding wrong?
>>
>>     Please suggest me in this regard.
> 
> I"m not sure. To be honest the idea of browsing messages on a topic
> via JMX is kinda bogus anyway. Browsing pending messages for a
> specific consumer, fair enough (particularly for a durable
> subscriber), but I don't have much of a clue what that code does or
> why I'm afraid.
> 
> -- 
> James
> -------
> http://macstrac.blogspot.com/
> 
> 

-- 
View this message in context: http://www.nabble.com/Messages-from-the-topic-are-not-being-deleted-once-they-are-consume-tf3913879s12049.html#a11117964
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: Messages from the topic are not being deleted once they are consume

Posted by James Strachan <ja...@gmail.com>.
On 6/14/07, Arif Mohd <ar...@wipro.com> wrote:
>
> Hi James,
>     Iam not recieving any duplicate message when i restart my client for the
> next time with same clientid,subscirption name, it is fine till this point.
>
>   But if i open jconsole, select the topic name say "topic1" under
> operations tab, if i click on browseMessages it is showing all the messages
>
>    what my understanding is the jconsole shouldn't show the messages which
> are already read,  some times if i click on browse messages button i will
> get alert saying OutOfMemory(due to huge messages which are already read)
>
>     From the above observation from jconsole iam assuming that the messages
> are not deleted from topic once they are read.Is my undersanding wrong?
>
>     Please suggest me in this regard.

I"m not sure. To be honest the idea of browsing messages on a topic
via JMX is kinda bogus anyway. Browsing pending messages for a
specific consumer, fair enough (particularly for a durable
subscriber), but I don't have much of a clue what that code does or
why I'm afraid.

-- 
James
-------
http://macstrac.blogspot.com/

Re: Messages from the topic are not being deleted once they are consume

Posted by Arif Mohd <ar...@wipro.com>.
Hi James,
    Iam not recieving any duplicate message when i restart my client for the
next time with same clientid,subscirption name, it is fine till this point.

  But if i open jconsole, select the topic name say "topic1" under
operations tab, if i click on browseMessages it is showing all the messages

   what my understanding is the jconsole shouldn't show the messages which
are already read,  some times if i click on browse messages button i will
get alert saying OutOfMemory(due to huge messages which are already read)

    From the above observation from jconsole iam assuming that the messages
are not deleted from topic once they are read.Is my undersanding wrong?

    Please suggest me in this regard.




James.Strachan wrote:
> 
> On 6/14/07, Arif Mohd <ar...@wipro.com> wrote:
>>
>> Hi James,
>>
>>     I read the article for persistence. But iam having still one doubt
>>        1) if i use journal and JDBC together, once the message is moved
>> to
>> DataBase(which means at check points it is moved from journal to DB) i
>> should not see that message in jconsole but iam still able to see that
>> message.
> 
> I don't completely understand what jconsole shows for topics :)
> 
> If you create a consumer, consume messages & ack them; then close &
> restart the same consumer (with the same clientID and subscriberName)
> do you get duplicates?
> 
> -- 
> James
> -------
> http://macstrac.blogspot.com/
> 
> 

-- 
View this message in context: http://www.nabble.com/Messages-from-the-topic-are-not-being-deleted-once-they-are-consume-tf3913879s12049.html#a11117347
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: Messages from the topic are not being deleted once they are consume

Posted by James Strachan <ja...@gmail.com>.
On 6/14/07, Arif Mohd <ar...@wipro.com> wrote:
>
> Hi James,
>
>     I read the article for persistence. But iam having still one doubt
>        1) if i use journal and JDBC together, once the message is moved to
> DataBase(which means at check points it is moved from journal to DB) i
> should not see that message in jconsole but iam still able to see that
> message.

I don't completely understand what jconsole shows for topics :)

If you create a consumer, consume messages & ack them; then close &
restart the same consumer (with the same clientID and subscriberName)
do you get duplicates?

-- 
James
-------
http://macstrac.blogspot.com/

Re: Messages from the topic are not being deleted once they are consume

Posted by Arif Mohd <ar...@wipro.com>.
Hi James,

    I read the article for persistence. But iam having still one doubt
       1) if i use journal and JDBC together, once the message is moved to
DataBase(which means at check points it is moved from journal to DB) i
should not see that message in jconsole but iam still able to see that
message.
     2) what i observed it TTL is 0 in DB(which means infinity), but still
once the message is moved to DB i shouldn't get it in jconsole(whether it
may be acknowledged or not)

       

James.Strachan wrote:
> 
> On 6/14/07, Arif Mohd <ar...@wipro.com> wrote:
>>
>> Yes i mean to say when they are acknowledged, iam using same clientid and
>> subscription name each time
>>
>>     1) i saw the table activemq_msgs, the acknowledged messages are not
>> there in this table for topic
>> but if i see from jconsole they are there still in memory
> 
> Thats an effect of the journal. Some background there
> http://activemq.apache.org/persistence.html
> 
> but basically messages are writting to the database asynchronously at
> the checkpoint of the journal. So for some time after sending a
> message you won't  see them in the JDBC database (but they will be on
> disk in the journal).
> 
> If you don't mind slowing things down by a factor of 10-20x, you can
> disable the journal so that things go straight to the database.
> 
> 
>>     2) there is only one record in activemq_acks table for the topic and
>> the
>> value for the last_acked_id value is changing, is this its behaviour?
> 
> Yes
> 
>>     3) Can you please tell me what is the difference between columns
>> activemq_msgs.id and activemq_msgs.msgid_prod and activemq_msgs.msgid_seq
> 
> the producer ID is the ID of the person sending the message; the
> sequence number is generated by the producer.
> 
> -- 
> James
> -------
> http://macstrac.blogspot.com/
> 
> 

-- 
View this message in context: http://www.nabble.com/Messages-from-the-topic-are-not-being-deleted-once-they-are-consume-tf3913879s12049.html#a11116073
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: Messages from the topic are not being deleted once they are consume

Posted by James Strachan <ja...@gmail.com>.
On 6/14/07, Arif Mohd <ar...@wipro.com> wrote:
>
> Yes i mean to say when they are acknowledged, iam using same clientid and
> subscription name each time
>
>     1) i saw the table activemq_msgs, the acknowledged messages are not
> there in this table for topic
> but if i see from jconsole they are there still in memory

Thats an effect of the journal. Some background there
http://activemq.apache.org/persistence.html

but basically messages are writting to the database asynchronously at
the checkpoint of the journal. So for some time after sending a
message you won't  see them in the JDBC database (but they will be on
disk in the journal).

If you don't mind slowing things down by a factor of 10-20x, you can
disable the journal so that things go straight to the database.


>     2) there is only one record in activemq_acks table for the topic and the
> value for the last_acked_id value is changing, is this its behaviour?

Yes

>     3) Can you please tell me what is the difference between columns
> activemq_msgs.id and activemq_msgs.msgid_prod and activemq_msgs.msgid_seq

the producer ID is the ID of the person sending the message; the
sequence number is generated by the producer.

-- 
James
-------
http://macstrac.blogspot.com/

Re: Messages from the topic are not being deleted once they are consume

Posted by Arif Mohd <ar...@wipro.com>.
Yes i mean to say when they are acknowledged, iam using same clientid and
subscription name each time

    1) i saw the table activemq_msgs, the acknowledged messages are not
there in this table for topic
but if i see from jconsole they are there still in memory
    2) there is only one record in activemq_acks table for the topic and the
value for the last_acked_id value is changing, is this its behaviour?
    3) Can you please tell me what is the difference between columns
activemq_msgs.id and activemq_msgs.msgid_prod and activemq_msgs.msgid_seq

   
 

James.Strachan wrote:
> 
> On 6/13/07, Arif Mohd <ar...@wipro.com> wrote:
>>
>> Hi,
>>
>>    Could any body knows why messages from a topic are not removed once
>> they
>> are subsribed
> 
> You mean once they are acknowledged (rather than subscribed?).
> 
> You're definitely using the same clientID and subscriber name each
> time right? Otherwise each subscription is effectively a new durable
> subscription.
> 
> Or are you referring to the fact that messages are removed lazily from
> the JDBC table after all the consumers acknowledge them?
> -- 
> James
> -------
> http://macstrac.blogspot.com/
> 
> 

-- 
View this message in context: http://www.nabble.com/Messages-from-the-topic-are-not-being-deleted-once-they-are-consume-tf3913879s12049.html#a11114296
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: Messages from the topic are not being deleted once they are consume

Posted by James Strachan <ja...@gmail.com>.
On 6/13/07, Arif Mohd <ar...@wipro.com> wrote:
>
> Hi,
>
>    Could any body knows why messages from a topic are not removed once they
> are subsribed

You mean once they are acknowledged (rather than subscribed?).

You're definitely using the same clientID and subscriber name each
time right? Otherwise each subscription is effectively a new durable
subscription.

Or are you referring to the fact that messages are removed lazily from
the JDBC table after all the consumers acknowledge them?
-- 
James
-------
http://macstrac.blogspot.com/