Quantcast
Channel: Apache Timeline
Viewing all articles
Browse latest Browse all 5648

Reuse onException handler

$
0
0
Hello,

I have the following route:

onException(ConnectException.class)
.handled(true)
.process(new GlobalExceptionProcessor())
.to("jms:topic:responseTopic");

from("jms:mongoQueue?concurrentConsumers=20櫌ꝰ⨧닩=true")
.dynamicRouter(method(MongoConnection.class, "getConnection"))
.to("jms:topic:responseTopic");

I want to reuse the onException declaration on many other routes defined in
other classes. How can I do this without copy-pasting the declaration over
and over again? Can I somehow move the onException in a bean?

Viewing all articles
Browse latest Browse all 5648

Trending Articles