You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Ephemeris Lappis <ep...@gmail.com> on 2025/03/11 13:06:42 UTC
Camel JMS consumer with dynamic selector to read ActiveMQ DLQueues
Hello.
I'm looking for a simple way to clean DLQ queues on our ActiveMQ brokers.
Messages are moved to DLQ queues when some unexpected conditions lead
consumers to fail. We've no automatic processing for DLQ messages that are
only needed for diagnosis. Nevertheless, when the queues contain too many
messages, the ActiveMQ console or alternative browsing tools are not able
to handle them, and, by the way, thousands of messages are useless. This is
why we're looking for a periodic cleaning. For example, we could remove all
messages that are older than N days.
A JMS selector can be used to check the JMSTimestamp is before a given
time. But I can't find any way to write a route with a JMS 'from' statement
that could evaluate something like : JMSTimestamp < NOW() - INTERVAL '7
days'...
I imagine that more complex solutions could be considered, consuming all
the DLQ queues messages, and moving them to other queues with an expiration
time, setting a policy to delete expired messages. But this is not our
first choice...
I've also searched for a way to force ActiveMQ to set an expiration time on
all DLQ messages, but It seems it's not possible.
Any ideas are welcome !
Thanks in advance.
Regards.
Re: Camel JMS consumer with dynamic selector to read ActiveMQ DLQueues
Posted by Ephemeris Lappis <ep...@gmail.com>.
Hello.
Original messages globally (we already have some kind of messages that use
it) must not have a time to live. And I found no way to tell ActiveMQ to
add a time to live when a message is moved to a DLQ by a rollback of the
recipient process :I don't think we have to change the transaction handlers
in Camel contexts or Spring Boot applications to alter messages on rollback.
Thanks anyway.
Regards.
Le mar. 11 mars 2025 à 14:42, Mattern, Alex <al...@bbh.com.invalid>
a écrit :
> If you are just looking to trash old messages then use the timeToLive
> setting when producing messages on the DLQ.
> https://camel.apache.org/components/4.10.x/eips/message-expiration.html
>
> If you want a manually triggered process, then you can create a consumer
> application that consumes X number of messages, where X is specified on
> startup.
> --
> Alex
>
> -----Original Message-----
> From: Ephemeris Lappis <ep...@gmail.com>
> Sent: Tuesday, March 11, 2025 9:07 AM
> To: users@camel.apache.org; users@activemq.apache.org
> Subject: [EXTERNAL SENDER:] Camel JMS consumer with dynamic selector to
> read ActiveMQ DLQueues
>
> Hello.
>
> I'm looking for a simple way to clean DLQ queues on our ActiveMQ brokers.
> Messages are moved to DLQ queues when some unexpected conditions lead
> consumers to fail. We've no automatic processing for DLQ messages that are
> only needed for diagnosis. Nevertheless, when the queues contain too many
> messages, the ActiveMQ console or alternative browsing tools are not able
> to handle them, and, by the way, thousands of messages are useless. This is
> why we're looking for a periodic cleaning. For example, we could remove all
> messages that are older than N days.
>
> A JMS selector can be used to check the JMSTimestamp is before a given
> time. But I can't find any way to write a route with a JMS 'from' statement
> that could evaluate something like : JMSTimestamp < NOW() - INTERVAL '7
> days'...
>
> I imagine that more complex solutions could be considered, consuming all
> the DLQ queues messages, and moving them to other queues with an expiration
> time, setting a policy to delete expired messages. But this is not our
> first choice...
>
> I've also searched for a way to force ActiveMQ to set an expiration time
> on all DLQ messages, but It seems it's not possible.
>
> Any ideas are welcome !
>
> Thanks in advance.
>
> Regards.
>
> *************************** IMPORTANT NOTE*****************************
> The opinions expressed in this message and/or any attachments are those of
> the author and not necessarily those of Brown Brothers Harriman & Co., its
> subsidiaries and affiliates ("BBH"). There is no guarantee that this
> message is either private or confidential, and it may have been altered by
> unauthorized sources without your or our knowledge. Nothing in the message
> is capable or intended to create any legally binding obligations on either
> party and it is not intended to provide legal advice. BBH accepts no
> responsibility for loss or damage from its use, including damage from virus.
>
> ******************************************************************************
>
Re: Camel JMS consumer with dynamic selector to read ActiveMQ DLQueues
Posted by Ephemeris Lappis <ep...@gmail.com>.
Hello.
Original messages globally (we already have some kind of messages that use
it) must not have a time to live. And I found no way to tell ActiveMQ to
add a time to live when a message is moved to a DLQ by a rollback of the
recipient process :I don't think we have to change the transaction handlers
in Camel contexts or Spring Boot applications to alter messages on rollback.
Thanks anyway.
Regards.
Le mar. 11 mars 2025 à 14:42, Mattern, Alex <al...@bbh.com.invalid>
a écrit :
> If you are just looking to trash old messages then use the timeToLive
> setting when producing messages on the DLQ.
> https://camel.apache.org/components/4.10.x/eips/message-expiration.html
>
> If you want a manually triggered process, then you can create a consumer
> application that consumes X number of messages, where X is specified on
> startup.
> --
> Alex
>
> -----Original Message-----
> From: Ephemeris Lappis <ep...@gmail.com>
> Sent: Tuesday, March 11, 2025 9:07 AM
> To: users@camel.apache.org; users@activemq.apache.org
> Subject: [EXTERNAL SENDER:] Camel JMS consumer with dynamic selector to
> read ActiveMQ DLQueues
>
> Hello.
>
> I'm looking for a simple way to clean DLQ queues on our ActiveMQ brokers.
> Messages are moved to DLQ queues when some unexpected conditions lead
> consumers to fail. We've no automatic processing for DLQ messages that are
> only needed for diagnosis. Nevertheless, when the queues contain too many
> messages, the ActiveMQ console or alternative browsing tools are not able
> to handle them, and, by the way, thousands of messages are useless. This is
> why we're looking for a periodic cleaning. For example, we could remove all
> messages that are older than N days.
>
> A JMS selector can be used to check the JMSTimestamp is before a given
> time. But I can't find any way to write a route with a JMS 'from' statement
> that could evaluate something like : JMSTimestamp < NOW() - INTERVAL '7
> days'...
>
> I imagine that more complex solutions could be considered, consuming all
> the DLQ queues messages, and moving them to other queues with an expiration
> time, setting a policy to delete expired messages. But this is not our
> first choice...
>
> I've also searched for a way to force ActiveMQ to set an expiration time
> on all DLQ messages, but It seems it's not possible.
>
> Any ideas are welcome !
>
> Thanks in advance.
>
> Regards.
>
> *************************** IMPORTANT NOTE*****************************
> The opinions expressed in this message and/or any attachments are those of
> the author and not necessarily those of Brown Brothers Harriman & Co., its
> subsidiaries and affiliates ("BBH"). There is no guarantee that this
> message is either private or confidential, and it may have been altered by
> unauthorized sources without your or our knowledge. Nothing in the message
> is capable or intended to create any legally binding obligations on either
> party and it is not intended to provide legal advice. BBH accepts no
> responsibility for loss or damage from its use, including damage from virus.
>
> ******************************************************************************
>
RE: Camel JMS consumer with dynamic selector to read ActiveMQ DLQueues
Posted by "Mattern, Alex" <al...@bbh.com.INVALID>.
If you are just looking to trash old messages then use the timeToLive setting when producing messages on the DLQ.
https://camel.apache.org/components/4.10.x/eips/message-expiration.html
If you want a manually triggered process, then you can create a consumer application that consumes X number of messages, where X is specified on startup.
--
Alex
-----Original Message-----
From: Ephemeris Lappis <ep...@gmail.com>
Sent: Tuesday, March 11, 2025 9:07 AM
To: users@camel.apache.org; users@activemq.apache.org
Subject: [EXTERNAL SENDER:] Camel JMS consumer with dynamic selector to read ActiveMQ DLQueues
Hello.
I'm looking for a simple way to clean DLQ queues on our ActiveMQ brokers.
Messages are moved to DLQ queues when some unexpected conditions lead consumers to fail. We've no automatic processing for DLQ messages that are only needed for diagnosis. Nevertheless, when the queues contain too many messages, the ActiveMQ console or alternative browsing tools are not able to handle them, and, by the way, thousands of messages are useless. This is why we're looking for a periodic cleaning. For example, we could remove all messages that are older than N days.
A JMS selector can be used to check the JMSTimestamp is before a given time. But I can't find any way to write a route with a JMS 'from' statement that could evaluate something like : JMSTimestamp < NOW() - INTERVAL '7 days'...
I imagine that more complex solutions could be considered, consuming all the DLQ queues messages, and moving them to other queues with an expiration time, setting a policy to delete expired messages. But this is not our first choice...
I've also searched for a way to force ActiveMQ to set an expiration time on all DLQ messages, but It seems it's not possible.
Any ideas are welcome !
Thanks in advance.
Regards.
*************************** IMPORTANT NOTE*****************************
The opinions expressed in this message and/or any attachments are those of the author and not necessarily those of Brown Brothers Harriman & Co., its subsidiaries and affiliates ("BBH"). There is no guarantee that this message is either private or confidential, and it may have been altered by unauthorized sources without your or our knowledge. Nothing in the message is capable or intended to create any legally binding obligations on either party and it is not intended to provide legal advice. BBH accepts no responsibility for loss or damage from its use, including damage from virus.
******************************************************************************
Re: Camel JMS consumer with dynamic selector to read ActiveMQ DLQueues
Posted by Robbie Gemmell <ro...@gmail.com>.
I haven't used it personally, but on your last point around setting
expiration on DLQ messages...a quick google turned up this page
suggesting it can do that since 5.12.0:
https://activemq.apache.org/components/classic/documentation/message-redelivery-and-dlq-handling
Look for the section headed "Setting Expiration on Messages in the
DLQ" approaching half way down.
On Tue, 11 Mar 2025 at 13:07, Ephemeris Lappis
<ep...@gmail.com> wrote:
>
> Hello.
>
> I'm looking for a simple way to clean DLQ queues on our ActiveMQ brokers.
> Messages are moved to DLQ queues when some unexpected conditions lead
> consumers to fail. We've no automatic processing for DLQ messages that are
> only needed for diagnosis. Nevertheless, when the queues contain too many
> messages, the ActiveMQ console or alternative browsing tools are not able
> to handle them, and, by the way, thousands of messages are useless. This is
> why we're looking for a periodic cleaning. For example, we could remove all
> messages that are older than N days.
>
> A JMS selector can be used to check the JMSTimestamp is before a given
> time. But I can't find any way to write a route with a JMS 'from' statement
> that could evaluate something like : JMSTimestamp < NOW() - INTERVAL '7
> days'...
>
> I imagine that more complex solutions could be considered, consuming all
> the DLQ queues messages, and moving them to other queues with an expiration
> time, setting a policy to delete expired messages. But this is not our
> first choice...
>
> I've also searched for a way to force ActiveMQ to set an expiration time on
> all DLQ messages, but It seems it's not possible.
>
> Any ideas are welcome !
>
> Thanks in advance.
>
> Regards.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@activemq.apache.org
For additional commands, e-mail: users-help@activemq.apache.org
For further information, visit: https://activemq.apache.org/contact
Re: Camel JMS consumer with dynamic selector to read ActiveMQ DLQueues
Posted by Ephemeris Lappis <ep...@gmail.com>.
Hello
We're using ActiveMQ "classic" 5.18.3
Regards.
Le mar. 11 mars 2025 à 15:01, Justin Bertram <jb...@apache.org> a écrit :
> Are you using ActiveMQ Classic or ActiveMQ Artemis? Also which version are
> you using?
>
>
> Justin
>
> On Tue, Mar 11, 2025 at 8:08 AM Ephemeris Lappis <
> ephemeris.lappis@gmail.com>
> wrote:
>
> > Hello.
> >
> > I'm looking for a simple way to clean DLQ queues on our ActiveMQ brokers.
> > Messages are moved to DLQ queues when some unexpected conditions lead
> > consumers to fail. We've no automatic processing for DLQ messages that
> are
> > only needed for diagnosis. Nevertheless, when the queues contain too many
> > messages, the ActiveMQ console or alternative browsing tools are not able
> > to handle them, and, by the way, thousands of messages are useless. This
> is
> > why we're looking for a periodic cleaning. For example, we could remove
> all
> > messages that are older than N days.
> >
> > A JMS selector can be used to check the JMSTimestamp is before a given
> > time. But I can't find any way to write a route with a JMS 'from'
> statement
> > that could evaluate something like : JMSTimestamp < NOW() - INTERVAL '7
> > days'...
> >
> > I imagine that more complex solutions could be considered, consuming all
> > the DLQ queues messages, and moving them to other queues with an
> expiration
> > time, setting a policy to delete expired messages. But this is not our
> > first choice...
> >
> > I've also searched for a way to force ActiveMQ to set an expiration time
> on
> > all DLQ messages, but It seems it's not possible.
> >
> > Any ideas are welcome !
> >
> > Thanks in advance.
> >
> > Regards.
> >
>
Re: Camel JMS consumer with dynamic selector to read ActiveMQ DLQueues
Posted by Justin Bertram <jb...@apache.org>.
Are you using ActiveMQ Classic or ActiveMQ Artemis? Also which version are
you using?
Justin
On Tue, Mar 11, 2025 at 8:08 AM Ephemeris Lappis <ep...@gmail.com>
wrote:
> Hello.
>
> I'm looking for a simple way to clean DLQ queues on our ActiveMQ brokers.
> Messages are moved to DLQ queues when some unexpected conditions lead
> consumers to fail. We've no automatic processing for DLQ messages that are
> only needed for diagnosis. Nevertheless, when the queues contain too many
> messages, the ActiveMQ console or alternative browsing tools are not able
> to handle them, and, by the way, thousands of messages are useless. This is
> why we're looking for a periodic cleaning. For example, we could remove all
> messages that are older than N days.
>
> A JMS selector can be used to check the JMSTimestamp is before a given
> time. But I can't find any way to write a route with a JMS 'from' statement
> that could evaluate something like : JMSTimestamp < NOW() - INTERVAL '7
> days'...
>
> I imagine that more complex solutions could be considered, consuming all
> the DLQ queues messages, and moving them to other queues with an expiration
> time, setting a policy to delete expired messages. But this is not our
> first choice...
>
> I've also searched for a way to force ActiveMQ to set an expiration time on
> all DLQ messages, but It seems it's not possible.
>
> Any ideas are welcome !
>
> Thanks in advance.
>
> Regards.
>
RE: Camel JMS consumer with dynamic selector to read ActiveMQ DLQueues
Posted by "Mattern, Alex" <al...@bbh.com.INVALID>.
If you are just looking to trash old messages then use the timeToLive setting when producing messages on the DLQ.
https://camel.apache.org/components/4.10.x/eips/message-expiration.html
If you want a manually triggered process, then you can create a consumer application that consumes X number of messages, where X is specified on startup.
--
Alex
-----Original Message-----
From: Ephemeris Lappis <ep...@gmail.com>
Sent: Tuesday, March 11, 2025 9:07 AM
To: users@camel.apache.org; users@activemq.apache.org
Subject: [EXTERNAL SENDER:] Camel JMS consumer with dynamic selector to read ActiveMQ DLQueues
Hello.
I'm looking for a simple way to clean DLQ queues on our ActiveMQ brokers.
Messages are moved to DLQ queues when some unexpected conditions lead consumers to fail. We've no automatic processing for DLQ messages that are only needed for diagnosis. Nevertheless, when the queues contain too many messages, the ActiveMQ console or alternative browsing tools are not able to handle them, and, by the way, thousands of messages are useless. This is why we're looking for a periodic cleaning. For example, we could remove all messages that are older than N days.
A JMS selector can be used to check the JMSTimestamp is before a given time. But I can't find any way to write a route with a JMS 'from' statement that could evaluate something like : JMSTimestamp < NOW() - INTERVAL '7 days'...
I imagine that more complex solutions could be considered, consuming all the DLQ queues messages, and moving them to other queues with an expiration time, setting a policy to delete expired messages. But this is not our first choice...
I've also searched for a way to force ActiveMQ to set an expiration time on all DLQ messages, but It seems it's not possible.
Any ideas are welcome !
Thanks in advance.
Regards.
*************************** IMPORTANT NOTE*****************************
The opinions expressed in this message and/or any attachments are those of the author and not necessarily those of Brown Brothers Harriman & Co., its subsidiaries and affiliates ("BBH"). There is no guarantee that this message is either private or confidential, and it may have been altered by unauthorized sources without your or our knowledge. Nothing in the message is capable or intended to create any legally binding obligations on either party and it is not intended to provide legal advice. BBH accepts no responsibility for loss or damage from its use, including damage from virus.
******************************************************************************
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@activemq.apache.org
For additional commands, e-mail: users-help@activemq.apache.org
For further information, visit: https://activemq.apache.org/contact