You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by catequil <br...@yahoo.com> on 2017/01/25 19:51:13 UTC

Camel route not getting to aggregation and bean in certain cases

*Camel route not getting to aggregation and bean in certain cases.*
Below is my camel route.  When the route encounters a SoapFault the route
works great.  However, in the case of success from the soap call the route
never gets to the aggregation and bean calls marked <==== below.  I would
expect that the call to "direct:processDeviceUsageSoapCall" would eventually
get an exchange body from the DeviceUsageHistoryPostProcessor.  Is this not
the expected result?  What am I doing wrong?





--
View this message in context: http://camel.465427.n5.nabble.com/Camel-route-not-getting-to-aggregation-and-bean-in-certain-cases-tp5793058.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel route not getting to aggregation and bean in certain cases

Posted by catequil <br...@yahoo.com>.
*Solution:*So I found the problem.  The problem was with my
doTry...Catch...[endDoTry] block.Do not use the endDoTry closing method. 
Just call end to end your try catch block.  Can we some how add to the
docmentation to not use the endDoTry and/or explain what the endDoTry
does.Or can we remove the endDoTry method all together to reduce confusion
for those using autocomplete.  Or lastly fix endDoTry to work just like the
end method.  I think that it would help others in the future to do one of
these things.Thanks



--
View this message in context: http://camel.465427.n5.nabble.com/Camel-route-not-getting-to-aggregation-and-bean-in-certain-cases-tp5793058p5793090.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel route not getting to aggregation and bean in certain cases

Posted by catequil <br...@yahoo.com>.
I placed a log call here:


It only printed out when there was an error, with the same results as
before.  The aggregationId was in the header for the error one, but then
again I only got the one 'error' result continuing.

Thanks for your quick reply!



--
View this message in context: http://camel.465427.n5.nabble.com/Camel-route-not-getting-to-aggregation-and-bean-in-certain-cases-tp5793058p5793061.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel route not getting to aggregation and bean in certain cases

Posted by souciance <so...@gmail.com>.
A bit hard to tell but why don't you put a .log() statement before the
.aggregate and see how your body and headers look? Do you get a header with
aggregationId?

On Wed, Jan 25, 2017 at 8:51 PM, catequil [via Camel] <
ml-node+s465427n5793058h61@n5.nabble.com> wrote:

> *Camel route not getting to aggregation and bean in certain cases.*
> Below is my camel route.  When the route encounters a SoapFault the route
> works great.  However, in the case of success from the soap call the route
> never gets to the aggregation and bean calls marked <==== below.  I would
> expect that the call to "direct:processDeviceUsageSoapCall" would
> eventually get an exchange body from the DeviceUsageHistoryPostProcessor.
> Is this not the expected result?  What am I doing wrong?
>
> from("direct:processDeviceUsageJob").routeId("processDeviceUsageJob")
> 		.process(new DeviceUsageEndOfCycleProcessor()) //Sets the exchange body to List<Devices>
> 		.to("direct:processDeviceUsageAggregation");
>
> from("direct:processDeviceUsageAggregation")
> 		.split(body()) //Splits Devices from the list
> 		.doTry()
> 		.to("direct:processDeviceUsageSoapCall") //Each Device goes to be queried for usage
> 		.doCatch(SoapFault.class,
> 				UnknownHostException.class,
> 				ConnectException.class,
> 				SocketTimeoutException.class,
> 				NoRouteToHostException.class)
> 		.process(new BatchExceptionProcessor())
> 		.endDoTry()
>                 //Aggregation strategy combines totalUsage into one value
> 		.aggregate(header("aggregationId"), new TotalUsageAggregationStrategy())  <=========
> 		.completionTimeout(30000)
>                 //Saves totalUsage tot he database
> 		.bean(iSchedulerService, "saveDeviceUsageHistory")                                 <=========
> 		.log("*************************Done*****************************");
>
>
> from("direct:processDeviceUsageSoapCall")
> 		.process(new DeviceUsageHistoryPreProcessor(env))    //Prepares SOAP request
> 		.to(IEndPoints.URI_SOAP_DEVICE_USAGE_ENDPOINT) //Queries Soap Endpoint
> 		.process(new DeviceUsageHistoryPostProcessor());      //Receives SOAP response
>
>
>
> ------------------------------
> If you reply to this email, your message will be added to the discussion
> below:
> http://camel.465427.n5.nabble.com/Camel-route-not-getting-
> to-aggregation-and-bean-in-certain-cases-tp5793058.html
> To start a new topic under Camel - Users, email
> ml-node+s465427n465428h31@n5.nabble.com
> To unsubscribe from Camel - Users, click here
> <http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=465428&code=c291Y2lhbmNlLmVxZGFtLnJhc2h0aUBnbWFpbC5jb218NDY1NDI4fDE1MzI5MTE2NTY=>
> .
> NAML
> <http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>




--
View this message in context: http://camel.465427.n5.nabble.com/Camel-route-not-getting-to-aggregation-and-bean-in-certain-cases-tp5793058p5793059.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel route not getting to aggregation and bean in certain cases

Posted by catequil <br...@yahoo.com>.
So, I tried to consolidate the calls all into the same route where it is
getting dropped to see if having it in its own direct route was causing the
problem.  See new code below for reference.  No change in functionality
occurred.





--
View this message in context: http://camel.465427.n5.nabble.com/Camel-route-not-getting-to-aggregation-and-bean-in-certain-cases-tp5793058p5793063.html
Sent from the Camel - Users mailing list archive at Nabble.com.