[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

What route returns


I notice that if I split body without referencing aggregation strategy,
like this: split().body()
route returns the message like it was before splitting.
However, if I reference aggregation strategy in a split call like
this: .split(body(),new AggrStrat())
then route returns the message after aggregation. However, if I want to do
further tasks in a route after aggregator, in which I reference the same
strategy as in a splitter,
such as for example unmarshalling the aggregated message from fixedlength
format and marshalling into json, although these tasks were properly done,
which I can verify by logging body, the REST route that is calling the
observed route still receives the aggregated fixedlength message format.
So, basically I see json printed in java console, but in postman or browser
I get fixedlength format.
Does that mean that I have to implement conversion from fixedlength to json
in aggregation strategy class, or there is still a way to do it
somehow in a route builder class?

The outline of my route is like this:

        .setBody(simple("original request message"))


        .split(body(),new AgrStrat()).parallelProcessing()
        .process(new Processor() {
            public void process(Exchange exchange) throws Exception {
            //assemble new mq requests based on the content of splitted
response mq message


        .aggregate(constant(true),new AgrStrat()).completionTimeout(3000)

AgrStrat basically concatenates the newExchange with the oldExchange,
inserting "\n" in between, at the moment.
I guess I should move format conversion there? Thank you.