You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by rogster <er...@lmco.com> on 2009/06/10 22:59:24 UTC

Custome aggregator for splitter in camel 1.5.2

Hi,

Does the example, Split aggregate request/reply sample, at
http://camel.apache.org/splitter.html only work for Camel 2.0?  I'm using
camel 1.5.2 and I simply get the last split message returned to the caller,
rather than the output from my custom aggregator.  Looks like this was a
defect in 1.5.0:  https://issues.apache.org/activemq/browse/CAMEL-1041. 
Should it be fixed in 1.5.2?

Thanks,
Chris
-- 
View this message in context: http://www.nabble.com/Custome-aggregator-for-splitter-in-camel-1.5.2-tp23970911p23970911.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Custome aggregator for splitter in camel 1.5.2

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

In Camel 1.x its safer to *not* use the nested routes in splitter,
aggregator etc.
See: https://issues.apache.org/activemq/browse/CAMEL-1697

What is the best option is to use separate route for the split, and
then link to this route using the direct endpoint

from(x).to("direct:split").to(result)

from("direct:split")
   .splitter(....



On Thu, Jun 11, 2009 at 9:28 AM, Claus Ibsen<cl...@gmail.com> wrote:
> Hi
>
> Me again with a thought.
>
> I would like to look into supporting using a plain POJO for
> aggregation strategy to avoid being coupled to any Camel interfaces.
> This would also make it easier to work wit to avoid IN or OUT and whatnot.
>
> But the limitations would be that it works with bodies only. Well just
> wanna raise a flag for ideas.
> We could add annotations to help bind parameters.
>
> Or make some convention. For instance a plain method like this with 2
> parameters, and 1 return type.
> public String aggregateMe(String body, String newBody)
>
> Anyway just a thought.
>
>
> On Thu, Jun 11, 2009 at 9:25 AM, Claus Ibsen<cl...@gmail.com> wrote:
>> Hi
>>
>> On Wed, Jun 10, 2009 at 10:59 PM, rogster<er...@lmco.com> wrote:
>>>
>>> Hi,
>>>
>>> Does the example, Split aggregate request/reply sample, at
>>> http://camel.apache.org/splitter.html only work for Camel 2.0?  I'm using
>>> camel 1.5.2 and I simply get the last split message returned to the caller,
>>> rather than the output from my custom aggregator.  Looks like this was a
>>> defect in 1.5.0:  https://issues.apache.org/activemq/browse/CAMEL-1041.
>>> Should it be fixed in 1.5.2?
>>>
>> Yes it works in Camel 1.6.1.
>> I just ported the unit test from trunk to 1.x
>> http://svn.apache.org/viewvc?view=rev&revision=783655
>>
>> We have not released any 1.5.2 release. In fact neither a 1.5.1 release.
>> The latest is 1.6.1. Is it that release you are using?
>>
>> Anyway it should work on 1.6.1.
>>
>> Mind that you have to take care in your custom aggregator whether you
>> store the aggregated response
>> in either IN or OUT. It is in fact safest to store it in OUT.
>>
>>
>>
>>> Thanks,
>>> Chris
>>> --
>>> View this message in context: http://www.nabble.com/Custome-aggregator-for-splitter-in-camel-1.5.2-tp23970911p23970911.html
>>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>>
>>>
>>
>>
>>
>> --
>> Claus Ibsen
>> Apache Camel Committer
>>
>> Open Source Integration: http://fusesource.com
>> Blog: http://davsclaus.blogspot.com/
>> Twitter: http://twitter.com/davsclaus
>>
>
>
>
> --
> Claus Ibsen
> Apache Camel Committer
>
> Open Source Integration: http://fusesource.com
> Blog: http://davsclaus.blogspot.com/
> Twitter: http://twitter.com/davsclaus
>



-- 
Claus Ibsen
Apache Camel Committer

Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus

Re: Custome aggregator for splitter in camel 1.5.2

Posted by rogster <er...@lmco.com>.
Sounds like an interesting idea.  My only concern would be if a custom
isComplete function is needed on the aggregator.  Obviously, without the
header info, there would be limits to what could be done.  Of coarse, we
should be able to use the normal completed predicates (xpath, xquery,
simple, etc) to accomplish the same effect, but in the version I am using
(1.5), the custom isCompleted function seems to be required before camel
will actually use my bean as an aggregator.  That being said though, I
really like the idea.

 

Claus Ibsen-2 wrote:
> 
> Hi
> 
> Me again with a thought.
> 
> I would like to look into supporting using a plain POJO for
> aggregation strategy to avoid being coupled to any Camel interfaces.
> This would also make it easier to work wit to avoid IN or OUT and whatnot.
> 
> But the limitations would be that it works with bodies only. Well just
> wanna raise a flag for ideas.
> We could add annotations to help bind parameters.
> 
> Or make some convention. For instance a plain method like this with 2
> parameters, and 1 return type.
> public String aggregateMe(String body, String newBody)
> 
> Anyway just a thought.
> 
> 
> On Thu, Jun 11, 2009 at 9:25 AM, Claus Ibsen<cl...@gmail.com> wrote:
>> Hi
>>
>> On Wed, Jun 10, 2009 at 10:59 PM, rogster<er...@lmco.com> wrote:
>>>
>>> Hi,
>>>
>>> Does the example, Split aggregate request/reply sample, at
>>> http://camel.apache.org/splitter.html only work for Camel 2.0?  I'm
>>> using
>>> camel 1.5.2 and I simply get the last split message returned to the
>>> caller,
>>> rather than the output from my custom aggregator.  Looks like this was a
>>> defect in 1.5.0:  https://issues.apache.org/activemq/browse/CAMEL-1041.
>>> Should it be fixed in 1.5.2?
>>>
>> Yes it works in Camel 1.6.1.
>> I just ported the unit test from trunk to 1.x
>> http://svn.apache.org/viewvc?view=rev&revision=783655
>>
>> We have not released any 1.5.2 release. In fact neither a 1.5.1 release.
>> The latest is 1.6.1. Is it that release you are using?
>>
>> Anyway it should work on 1.6.1.
>>
>> Mind that you have to take care in your custom aggregator whether you
>> store the aggregated response
>> in either IN or OUT. It is in fact safest to store it in OUT.
>>
>>
>>
>>> Thanks,
>>> Chris
>>> --
>>> View this message in context:
>>> http://www.nabble.com/Custome-aggregator-for-splitter-in-camel-1.5.2-tp23970911p23970911.html
>>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>>
>>>
>>
>>
>>
>> --
>> Claus Ibsen
>> Apache Camel Committer
>>
>> Open Source Integration: http://fusesource.com
>> Blog: http://davsclaus.blogspot.com/
>> Twitter: http://twitter.com/davsclaus
>>
> 
> 
> 
> -- 
> Claus Ibsen
> Apache Camel Committer
> 
> Open Source Integration: http://fusesource.com
> Blog: http://davsclaus.blogspot.com/
> Twitter: http://twitter.com/davsclaus
> 
> 

-- 
View this message in context: http://www.nabble.com/Custome-aggregator-for-splitter-in-camel-1.5.2-tp23970911p23981211.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Custome aggregator for splitter in camel 1.5.2

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

Me again with a thought.

I would like to look into supporting using a plain POJO for
aggregation strategy to avoid being coupled to any Camel interfaces.
This would also make it easier to work wit to avoid IN or OUT and whatnot.

But the limitations would be that it works with bodies only. Well just
wanna raise a flag for ideas.
We could add annotations to help bind parameters.

Or make some convention. For instance a plain method like this with 2
parameters, and 1 return type.
public String aggregateMe(String body, String newBody)

Anyway just a thought.


On Thu, Jun 11, 2009 at 9:25 AM, Claus Ibsen<cl...@gmail.com> wrote:
> Hi
>
> On Wed, Jun 10, 2009 at 10:59 PM, rogster<er...@lmco.com> wrote:
>>
>> Hi,
>>
>> Does the example, Split aggregate request/reply sample, at
>> http://camel.apache.org/splitter.html only work for Camel 2.0?  I'm using
>> camel 1.5.2 and I simply get the last split message returned to the caller,
>> rather than the output from my custom aggregator.  Looks like this was a
>> defect in 1.5.0:  https://issues.apache.org/activemq/browse/CAMEL-1041.
>> Should it be fixed in 1.5.2?
>>
> Yes it works in Camel 1.6.1.
> I just ported the unit test from trunk to 1.x
> http://svn.apache.org/viewvc?view=rev&revision=783655
>
> We have not released any 1.5.2 release. In fact neither a 1.5.1 release.
> The latest is 1.6.1. Is it that release you are using?
>
> Anyway it should work on 1.6.1.
>
> Mind that you have to take care in your custom aggregator whether you
> store the aggregated response
> in either IN or OUT. It is in fact safest to store it in OUT.
>
>
>
>> Thanks,
>> Chris
>> --
>> View this message in context: http://www.nabble.com/Custome-aggregator-for-splitter-in-camel-1.5.2-tp23970911p23970911.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>
>>
>
>
>
> --
> Claus Ibsen
> Apache Camel Committer
>
> Open Source Integration: http://fusesource.com
> Blog: http://davsclaus.blogspot.com/
> Twitter: http://twitter.com/davsclaus
>



-- 
Claus Ibsen
Apache Camel Committer

Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus

Re: Custome aggregator for splitter in camel 1.5.2

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

On Wed, Jun 10, 2009 at 10:59 PM, rogster<er...@lmco.com> wrote:
>
> Hi,
>
> Does the example, Split aggregate request/reply sample, at
> http://camel.apache.org/splitter.html only work for Camel 2.0?  I'm using
> camel 1.5.2 and I simply get the last split message returned to the caller,
> rather than the output from my custom aggregator.  Looks like this was a
> defect in 1.5.0:  https://issues.apache.org/activemq/browse/CAMEL-1041.
> Should it be fixed in 1.5.2?
>
Yes it works in Camel 1.6.1.
I just ported the unit test from trunk to 1.x
http://svn.apache.org/viewvc?view=rev&revision=783655

We have not released any 1.5.2 release. In fact neither a 1.5.1 release.
The latest is 1.6.1. Is it that release you are using?

Anyway it should work on 1.6.1.

Mind that you have to take care in your custom aggregator whether you
store the aggregated response
in either IN or OUT. It is in fact safest to store it in OUT.



> Thanks,
> Chris
> --
> View this message in context: http://www.nabble.com/Custome-aggregator-for-splitter-in-camel-1.5.2-tp23970911p23970911.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>



-- 
Claus Ibsen
Apache Camel Committer

Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus