0

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..

1 Answer 1

1

You probably need to set continue(true) in your OnException code. See here: http://camel.apache.org/exception-clause.html

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.