You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by "Olivier.Roger" <ol...@bsb.com> on 2010/09/24 16:27:27 UTC

[Aggregator] Howto remove from persistency

Hello,

I am using the new HawtDB aggregatorRepository.
I saw in the documentation that aggregated messages can be published using
one of the 5 completion checks. 

I was wondering if there was a way not to publish message if completion is
not reach after a given time.

In my case I split a message in 3, which are transformed separately (by an
external process). The transformation can provoke and error. 
In the happy path I aggregate the 3 transformed parts back into a message.
Otherwise I would like the route to fails and the aggregated message for
that correlatedId to be removed from the aggregator repository.

I guess I can do that in Java using the repository Spring Bean, it that a
better way ?

Thanks in advance,

Olivier
-- 
View this message in context: http://camel.465427.n5.nabble.com/Aggregator-Howto-remove-from-persistency-tp2852702p2852702.html
Sent from the Camel - Users mailing list archive at Nabble.com.

RE: [SPAM] - Re: [Aggregator] Howto remove from persistency - Number of numbers in MIME From exceeds maximum threshold

Posted by "Olivier.Roger" <ol...@bsb.com>.
Indeed, I intended to use that header in a CBR to trigger the repository cleanup when needed.

Thanks for the fast reply

________________________________
Olivier Roger (Olivier.Roger@bsb.com<ma...@bsb.com>)
Consultant

BSB Belgium (www.bsb.com<http://www.bsb.com>)
Avenue Ath?na,2 - B-1348 Louvain-la-Neuve
T:+32 10 49 58 63 - F:+32  10 48 34 99
________________________________
BUSINESS SOLUTIONS BUILDERS DISCLAIMER
This e-mail message and any attachments are intended exclusively for the addressee(s) and may contain information which is confidential and/or protected by intellectual property rights. If you receive this e-mail by mistake, please notify immediately the sender, or Business Solutions Builders (by e-mail at disclaimer@bsb.com<ma...@bsb.com>), and delete the message and any attachments without printing, copying or opening it. Any disclosure, reproduction, distribution or use of this message or any attachments, by persons other than the designed addressee(s), is strictly prohibited. E-mail transmission and Internet use cannot be guaranteed to be secure. Business Solutions Builders and its subsidiaries cannot be held responsible for any loss, delay or damage arising from their use.
________________________________
__________
__________


From: Claus Ibsen-2 [via Camel] [mailto:ml-node+2852742-2071113178-45143@n5.nabble.com]
Sent: vendredi 24 septembre 2010 16:52
To: Olivier Roger
Subject: [SPAM] - Re: [Aggregator] Howto remove from persistency - Number of numbers in MIME From exceeds maximum threshold

On Fri, Sep 24, 2010 at 4:45 PM, Olivier.Roger <[hidden email]</user/SendEmail.jtp?type=node&node=2852742&i=0>> wrote:
>
> I see.
>
> I was thinking about something like a removeOnTimeout (default=false of
> course) that would use the existing completionTimeout attribute but change
> its behavior to remove the aggregated message instead of publishing it.
> --

Ah the published timeout message has a header which tells it was
completed due timeout.
You can then use that to just stop/discard the message.

See http://camel.apache.org/aggregator2
The completedBy header


> View this message in context: http://camel.465427.n5.nabble.com/Aggregator-Howto-remove-from-persistency-tp2852702p2852731.html<http://camel.465427.n5.nabble.com/Aggregator-Howto-remove-from-persistency-tp2852702p2852731.html?by-user=t>
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



--
Claus Ibsen
Apache Camel Committer

Author of Camel in Action: http://www.manning.com/ibsen/
Open Source Integration: http://fusesource.com<http://fusesource.com?by-user=t>
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus

________________________________
View message @ http://camel.465427.n5.nabble.com/Aggregator-Howto-remove-from-persistency-tp2852702p2852742.html
To unsubscribe from [Aggregator] Howto remove from persistency, click here<http://camel.465427.n5.nabble.com/template/TplServlet.jtp?tpl=unsubscribe_by_code&node=2852702&code=b2xpdmllci5yb2dlckBic2IuY29tfDI4NTI3MDJ8Njc1ODQxMTU1>.


-- 
View this message in context: http://camel.465427.n5.nabble.com/Aggregator-Howto-remove-from-persistency-tp2852702p2852759.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: [Aggregator] Howto remove from persistency

Posted by Claus Ibsen <cl...@gmail.com>.
On Fri, Sep 24, 2010 at 4:45 PM, Olivier.Roger <ol...@bsb.com> wrote:
>
> I see.
>
> I was thinking about something like a removeOnTimeout (default=false of
> course) that would use the existing completionTimeout attribute but change
> its behavior to remove the aggregated message instead of publishing it.
> --

Ah the published timeout message has a header which tells it was
completed due timeout.
You can then use that to just stop/discard the message.

See http://camel.apache.org/aggregator2
The completedBy header


> View this message in context: http://camel.465427.n5.nabble.com/Aggregator-Howto-remove-from-persistency-tp2852702p2852731.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
Claus Ibsen
Apache Camel Committer

Author of Camel in Action: http://www.manning.com/ibsen/
Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus

Re: [Aggregator] Howto remove from persistency

Posted by "Olivier.Roger" <ol...@bsb.com>.
Nice,

I see it's even already implemented.

Thanks!
-- 
View this message in context: http://camel.465427.n5.nabble.com/Aggregator-Howto-remove-from-persistency-tp2852702p2854867.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: [Aggregator] Howto remove from persistency

Posted by Claus Ibsen <cl...@gmail.com>.
On Fri, Sep 24, 2010 at 6:07 PM, Claus Ibsen <cl...@gmail.com> wrote:
> On Fri, Sep 24, 2010 at 6:03 PM, Olivier.Roger <ol...@bsb.com> wrote:
>>
>> That's exactly the idea.
>>
>> I agree that deleting messages is dangerous. That's why the option should be
>> set explicitly (disabled by default).
>> --
>
> Feel free to create a ticket in JIRA
>

I created the ticket
https://issues.apache.org/activemq/browse/CAMEL-3159

>
>> View this message in context: http://camel.465427.n5.nabble.com/Aggregator-Howto-remove-from-persistency-tp2852702p2852893.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>
>
>
>
> --
> Claus Ibsen
> Apache Camel Committer
>
> Author of Camel in Action: http://www.manning.com/ibsen/
> Open Source Integration: http://fusesource.com
> Blog: http://davsclaus.blogspot.com/
> Twitter: http://twitter.com/davsclaus
>



-- 
Claus Ibsen
Apache Camel Committer

Author of Camel in Action: http://www.manning.com/ibsen/
Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus

Re: [Aggregator] Howto remove from persistency

Posted by Claus Ibsen <cl...@gmail.com>.
On Fri, Sep 24, 2010 at 6:03 PM, Olivier.Roger <ol...@bsb.com> wrote:
>
> That's exactly the idea.
>
> I agree that deleting messages is dangerous. That's why the option should be
> set explicitly (disabled by default).
> --

Feel free to create a ticket in JIRA


> View this message in context: http://camel.465427.n5.nabble.com/Aggregator-Howto-remove-from-persistency-tp2852702p2852893.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
Claus Ibsen
Apache Camel Committer

Author of Camel in Action: http://www.manning.com/ibsen/
Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus

Re: [Aggregator] Howto remove from persistency

Posted by "Olivier.Roger" <ol...@bsb.com>.
That's exactly the idea. 

I agree that deleting messages is dangerous. That's why the option should be
set explicitly (disabled by default).
-- 
View this message in context: http://camel.465427.n5.nabble.com/Aggregator-Howto-remove-from-persistency-tp2852702p2852893.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: [Aggregator] Howto remove from persistency

Posted by Claus Ibsen <cl...@gmail.com>.
On Fri, Sep 24, 2010 at 4:45 PM, Olivier.Roger <ol...@bsb.com> wrote:
>
> I see.
>
> I was thinking about something like a removeOnTimeout (default=false of
> course) that would use the existing completionTimeout attribute but change
> its behavior to remove the aggregated message instead of publishing it.
> --

Yeah I can kinda see an use case for this. You are using the timeout
as a last resort to just say hey we could not aggregate this in lets
say 4 hours.
So lets just ignore the message.

Having an option on the aggregate to just auto discard those message
on timeout would help there to avoid the CBR and checking yourself.

Just wondering if this is a use case others use? Its still kinda
dangerous to discard messages.



> View this message in context: http://camel.465427.n5.nabble.com/Aggregator-Howto-remove-from-persistency-tp2852702p2852731.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
Claus Ibsen
Apache Camel Committer

Author of Camel in Action: http://www.manning.com/ibsen/
Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus

Re: [Aggregator] Howto remove from persistency

Posted by "Olivier.Roger" <ol...@bsb.com>.
I see.

I was thinking about something like a removeOnTimeout (default=false of
course) that would use the existing completionTimeout attribute but change
its behavior to remove the aggregated message instead of publishing it.
-- 
View this message in context: http://camel.465427.n5.nabble.com/Aggregator-Howto-remove-from-persistency-tp2852702p2852731.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: [Aggregator] Howto remove from persistency

Posted by Claus Ibsen <cl...@gmail.com>.
On Fri, Sep 24, 2010 at 4:27 PM, Olivier.Roger <ol...@bsb.com> wrote:
>
> Hello,
>
> I am using the new HawtDB aggregatorRepository.
> I saw in the documentation that aggregated messages can be published using
> one of the 5 completion checks.
>
> I was wondering if there was a way not to publish message if completion is
> not reach after a given time.
>
> In my case I split a message in 3, which are transformed separately (by an
> external process). The transformation can provoke and error.
> In the happy path I aggregate the 3 transformed parts back into a message.
> Otherwise I would like the route to fails and the aggregated message for
> that correlatedId to be removed from the aggregator repository.
>
> I guess I can do that in Java using the repository Spring Bean, it that a
> better way ?
>

Yeah you need to remove those manually from Java code.

Fell free to suggest API changes if there is something that can be done smarter.


> Thanks in advance,
>
> Olivier
> --
> View this message in context: http://camel.465427.n5.nabble.com/Aggregator-Howto-remove-from-persistency-tp2852702p2852702.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
Claus Ibsen
Apache Camel Committer

Author of Camel in Action: http://www.manning.com/ibsen/
Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus