Hi Claus,
I am using the suspend/resume route mechanism as you suggested.
in RoutePauser implements Processor class:
final CamelContext camelContext = exchange.getContext();
//resuming main route in 30 secs
scheduler.schedule(() -> {
System.out.println("resume route for
"+exchange.getIn().getBody(RawMediaAsset.class).getContentVersionId());
camelContext.resumeRoute(MAIN_ROUTE), 30, TimeUnit.SECONDS
}
)
new Thread(() -> {
System.out.println("suspend route for
"+exchange.getIn().getBody(RawMediaAsset.class).getContentVersionId());
try {
camelContext.suspendRoute(MAIN_ROUTE, 0, TimeUnit.SECONDS);
} catch (Exception e) {
e.printStackTrace();
}
})
.start();
And use it like this:
onException(ProvisionedThroughputExceededException.class)
.process(routePauser)
But it seems to do these to actions for all messages I am playing in the IN
Queue not only ONCE like I was expecting:
resume route for pips:pid:b03k3dlvbbb
suspend route for pips:pid:b03k3dlvbbb
suspend route for pips:pid:b03k3dlv
resume route for pips:pid:b03k3dlv
resume route for pips:pid:b03k3dlvaaa
suspend route for pips:pid:b03k3dlvaaa
What am I missing here?
Thank you,
Bogdan
--
View this message in context:
http://camel.465427.n5.nabble.com/Starting-and-Suspending-routes-tp472016p5793007.html
Sent from the Camel - Users mailing list archive at Nabble.com.