camel-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sergey Zolotaryov (JIRA)" <>
Subject [jira] [Commented] (CAMEL-6791) Aggregation result is lost when used with Jetty http endpoint
Date Wed, 09 Oct 2013 09:29:45 GMT


Sergey Zolotaryov commented on CAMEL-6791:

Ok. I figured out how to fix the code. Camel example on splitter helped a lot :)

Here is what has to be used in order for the aggregation work: 1) specify the aggregation
strategy in split definition, not after it, otherwise it does not work; 2) after the processor
that handles split sub-exchanges you must say end() so that sub-exchanges don't get returned
by jetty. 

Here is how the changed code looks like:

route = route.split(splitExchangeIntoOneExchangePerFile(), new GroupedExchangeAggregationStrategy());

// now move/copy(?) the files to final destination
route ="file://output?fileName=${header." + BATCH_FILE_INDEX + "}.txt").end();

// no explicit aggregation afterwards

> Aggregation result is lost when used with Jetty http endpoint
> -------------------------------------------------------------
>                 Key: CAMEL-6791
>                 URL:
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-http
>    Affects Versions: 2.9.0, 2.12.1
>         Environment: windows 7
>            Reporter: Sergey Zolotaryov
>            Priority: Minor
>         Attachments:
> We have a requirement to return the result of some processing in an HTTP response. Here's
how this looks:
> Jetty http endpoint triggers processing -> 
> data is retrieved into an iterator -> 
> multiple renderers process the model objects and write output to temporary files ->

> a file endpoint copies files to final destination ->
> an aggregator puts generated file names into exchange body as a list ->
> the camel servlet renders the exchange body
> Everything goes well until the final step, where we can only see the filenames of temporary
files, but not the final ones. Looks like the aggregation result is just ignored. I am attaching
an eclipse project where you can just see how it happens.

This message was sent by Atlassian JIRA

View raw message