You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Francisco <ci...@iti.upv.es> on 2013/06/21 16:24:09 UTC

How to delete a persistent message

Hi all,

Regarding persistent messages, I discovered an undesired behavior I would
like to confirm here:

 - I know persistent messages will be saved on disk as they are received in
the broker. That's fine.
 - However, I thought that those messages would be automatically deleted
once all the subscribers confirm the reception of the message. However, it
seems to me that they still saved on disk forever and ever.
 - I thought I could solve this by setting a time ti expire. However, it
doesn't seems to work for me.

So, here are my questions: 
 - Are persistent messages meant to live forever in the BBDD? In such case,
my BBDD will keep growing and growing...
 - Do I have any mean to delete those messages programatically (via Java)?

Many thanks in advance,
Francisco



--
View this message in context: http://activemq.2283324.n4.nabble.com/How-to-delete-a-persistent-message-tp4668470.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: Re:Re:Re: How to delete a persistent message

Posted by Francisco <ci...@iti.upv.es>.
The first comment head me in the right direction, and the last link gave me
invaluable information on how to debug the AMQ movements.

Eventually, it seems to be a problem of pending ACK. I'll take a deeper look
on it, because all the messages have been correctly delivered, but sometimes
AMQ does not receive the ACK from one of the subscribers.

In any case, thank you very much for your answers. As soon as I have a
definitive solution, I'll post it here.



--
View this message in context: http://activemq.2283324.n4.nabble.com/How-to-delete-a-persistent-message-tp4668470p4668632.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re:Re:Re: How to delete a persistent message

Posted by SuoNayi <su...@163.com>.
Hi, take a peek at 
http://activemq.apache.org/why-do-kahadb-log-files-remain-after-cleanup.html




At 2013-06-25 10:13:51,SuoNayi <su...@163.com> wrote:
>There's a option which can be turned on to logging why a KahaDB file can not 
>be deleted when cleanup is performing.But I can not recall how to turn on it...
>
>
>
>
>At 2013-06-24 23:42:18,"Christian Posta" <ch...@gmail.com> wrote:
>>Messages are logically deleted, in that they will no longer be associated
>>with a destination, and the index tracks that. However, as for their
>>appearance on disk, they will live in the journal file until the journal
>>file is deleted, which happens automatically at defined intervals. You can
>>alter the frequency it checks for cleanup with <kahaDB cleanup="time"/>
>>property. If you don't want them auto removed, you can even archive them.
>>If you're running into a situation where the number of log files you have
>>grows unbounded, then there's a reason why those logs are staying around,
>>ie, the contents aren't unused (messages not being ack'd)?
>>
>>http://activemq.apache.org/kahadb.html
>>
>>
>>On Fri, Jun 21, 2013 at 10:24 AM, Francisco <ci...@iti.upv.es> wrote:
>>
>>> Hi all,
>>>
>>> Regarding persistent messages, I discovered an undesired behavior I would
>>> like to confirm here:
>>>
>>>  - I know persistent messages will be saved on disk as they are received in
>>> the broker. That's fine.
>>>  - However, I thought that those messages would be automatically deleted
>>> once all the subscribers confirm the reception of the message. However, it
>>> seems to me that they still saved on disk forever and ever.
>>>  - I thought I could solve this by setting a time ti expire. However, it
>>> doesn't seems to work for me.
>>>
>>> So, here are my questions:
>>>  - Are persistent messages meant to live forever in the BBDD? In such case,
>>> my BBDD will keep growing and growing...
>>>  - Do I have any mean to delete those messages programatically (via Java)?
>>>
>>> Many thanks in advance,
>>> Francisco
>>>
>>>
>>>
>>> --
>>> View this message in context:
>>> http://activemq.2283324.n4.nabble.com/How-to-delete-a-persistent-message-tp4668470.html
>>> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>>>
>>
>>
>>
>>-- 
>>*Christian Posta*
>>http://www.christianposta.com/blog
>>twitter: @christianposta

Re:Re: How to delete a persistent message

Posted by SuoNayi <su...@163.com>.
There's a option which can be turned on to logging why a KahaDB file can not 
be deleted when cleanup is performing.But I can not recall how to turn on it...




At 2013-06-24 23:42:18,"Christian Posta" <ch...@gmail.com> wrote:
>Messages are logically deleted, in that they will no longer be associated
>with a destination, and the index tracks that. However, as for their
>appearance on disk, they will live in the journal file until the journal
>file is deleted, which happens automatically at defined intervals. You can
>alter the frequency it checks for cleanup with <kahaDB cleanup="time"/>
>property. If you don't want them auto removed, you can even archive them.
>If you're running into a situation where the number of log files you have
>grows unbounded, then there's a reason why those logs are staying around,
>ie, the contents aren't unused (messages not being ack'd)?
>
>http://activemq.apache.org/kahadb.html
>
>
>On Fri, Jun 21, 2013 at 10:24 AM, Francisco <ci...@iti.upv.es> wrote:
>
>> Hi all,
>>
>> Regarding persistent messages, I discovered an undesired behavior I would
>> like to confirm here:
>>
>>  - I know persistent messages will be saved on disk as they are received in
>> the broker. That's fine.
>>  - However, I thought that those messages would be automatically deleted
>> once all the subscribers confirm the reception of the message. However, it
>> seems to me that they still saved on disk forever and ever.
>>  - I thought I could solve this by setting a time ti expire. However, it
>> doesn't seems to work for me.
>>
>> So, here are my questions:
>>  - Are persistent messages meant to live forever in the BBDD? In such case,
>> my BBDD will keep growing and growing...
>>  - Do I have any mean to delete those messages programatically (via Java)?
>>
>> Many thanks in advance,
>> Francisco
>>
>>
>>
>> --
>> View this message in context:
>> http://activemq.2283324.n4.nabble.com/How-to-delete-a-persistent-message-tp4668470.html
>> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>>
>
>
>
>-- 
>*Christian Posta*
>http://www.christianposta.com/blog
>twitter: @christianposta

Re: How to delete a persistent message

Posted by Christian Posta <ch...@gmail.com>.
Messages are logically deleted, in that they will no longer be associated
with a destination, and the index tracks that. However, as for their
appearance on disk, they will live in the journal file until the journal
file is deleted, which happens automatically at defined intervals. You can
alter the frequency it checks for cleanup with <kahaDB cleanup="time"/>
property. If you don't want them auto removed, you can even archive them.
If you're running into a situation where the number of log files you have
grows unbounded, then there's a reason why those logs are staying around,
ie, the contents aren't unused (messages not being ack'd)?

http://activemq.apache.org/kahadb.html


On Fri, Jun 21, 2013 at 10:24 AM, Francisco <ci...@iti.upv.es> wrote:

> Hi all,
>
> Regarding persistent messages, I discovered an undesired behavior I would
> like to confirm here:
>
>  - I know persistent messages will be saved on disk as they are received in
> the broker. That's fine.
>  - However, I thought that those messages would be automatically deleted
> once all the subscribers confirm the reception of the message. However, it
> seems to me that they still saved on disk forever and ever.
>  - I thought I could solve this by setting a time ti expire. However, it
> doesn't seems to work for me.
>
> So, here are my questions:
>  - Are persistent messages meant to live forever in the BBDD? In such case,
> my BBDD will keep growing and growing...
>  - Do I have any mean to delete those messages programatically (via Java)?
>
> Many thanks in advance,
> Francisco
>
>
>
> --
> View this message in context:
> http://activemq.2283324.n4.nabble.com/How-to-delete-a-persistent-message-tp4668470.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>



-- 
*Christian Posta*
http://www.christianposta.com/blog
twitter: @christianposta