You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Ishada <ab...@gmail.com> on 2015/12/20 16:14:08 UTC

Composed Message Processor

I am using Apache Camel in my Application. I am trying to use Composed
Message Processor. I have exchange whose body contains some URLs to hit and
by using split(body(), MyAggregationStrategy()), I am trying to get the data
from urls and using Aggregation Strategy want to combine each data. But
there is a problem where I am stuck. If there is some invalid url on the
first line of the body then it happens that aggregation is working fine but
it is not moving to the next processor and if invalid url is anywhere else
except first line than it is working fine.. please help, Here is the code
for reference.



onException(HttpOperationFailedException.class).handled(true)
            .retryAttemptedLogLevel(LoggingLevel.DEBUG)
            .maximumRedeliveries(5).redeliveryDelay(3000)
            .process(new HttpExceptionProcessor(exceptions));

from("jms:queue:supplier")
            .process(
                    new RequestParserProcessor(payloadDetailsMap,
                            metaDataDetailsPOJO, routesEndpointNamePOJO))
            .choice().when(new AggregateStrategy(metaDataDetailsPOJO))
            .to("direct:aggregate").otherwise().to("direct:single");

    from("direct:aggregate").process(new SplitBodyProcessor())
            .split(body(), new AggregatePayload(aggregatePayload))
            .to("direct:aggregatepayloadData").end()
            .to("direct:payloadDataAggregated").end();

    from("direct:aggregatepayloadData").process(basicProcessor)
            .recipientList(header(ApplicationConstants.URL));

    from("direct:payloadDataAggregated")
            .process(
                    new AggregateJsonGenerator(aggregatePayload,
                            payloadDetailsMap, metaDataDetailsPOJO));



	

I am using Apache Camel in my Application. I am trying to use Composed
Message Processor. I have exchange whose body contains some URLs to hit and
by using split(body(), MyAggregationStrategy()), I am trying to get the data
from urls and using Aggregation Strategy want to combine each data. But
there is a problem where I am stuck. If there is some invalid url on the
first line of the body then it happens that aggregation is working fine but
it is not moving to the next processor and if invalid url is anywhere else
except first line than it is working fine.. please help, Here is the code
for reference

onException(HttpOperationFailedException.class).handled(true)
            .retryAttemptedLogLevel(LoggingLevel.DEBUG)
            .maximumRedeliveries(5).redeliveryDelay(3000)
            .process(new HttpExceptionProcessor(exceptions));

from("jms:queue:supplier")
            .process(
                    new RequestParserProcessor(payloadDetailsMap,
                            metaDataDetailsPOJO, routesEndpointNamePOJO))
            .choice().when(new AggregateStrategy(metaDataDetailsPOJO))
            .to("direct:aggregate").otherwise().to("direct:single");

    from("direct:aggregate").process(new SplitBodyProcessor())
            .split(body(), new AggregatePayload(aggregatePayload))
            .to("direct:aggregatepayloadData").end()
            .to("direct:payloadDataAggregated").end();

    from("direct:aggregatepayloadData").process(basicProcessor)
            .recipientList(header(ApplicationConstants.URL));

    from("direct:payloadDataAggregated")
            .process(
                    new AggregateJsonGenerator(aggregatePayload,
                            payloadDetailsMap, metaDataDetailsPOJO)).

In this code AggregateJsonProcessor is never called if there some invalid
url on the first hit..




--
View this message in context: http://camel.465427.n5.nabble.com/Composed-Message-Processor-tp5775300.html
Sent from the Camel - Users mailing list archive at Nabble.com.