Quantcast
Viewing all articles
Browse latest Browse all 5648

How to stop routing with onException ?

My routing is this way, and my endpoint in channel2 is down...

But still my channel3 is executed.

I have tried:
onException(Exception.class).process(new LogError()).stop();
onException(Exception.class).process(new LogError()).end();
onException(Exception.class).process(new LogError()).handled(true);

But still my channel3 is executed..

Any ideas out there ?

Route:

onException(Exception.class).process(new LogError()).handled(true);

from("cxf:bean:hubws?dataFormat=MESSAGE").streamCaching()
.bean(AddIpBean.class)
.bean(SetRoutingKey.class)
.multicast()
.to("direct:channel1", "direct:channel2","direct:channel3");

from("direct:channel1")
.setHeader(LOGSTATE, constant(MQSTART))
.bean(Mq.class, "mqHeaders")
.bean(Mq.class, "logStart")
.inOnly("activemq:topic:HUB_TOP01");

from("direct:channel2")
.recipientList().method(Util.class, "getEndpoint");

from("direct:channel3")
.setHeader(LOGSTATE, constant(MQSLUT))
.bean(Mq.class, "mqHeaders")
.bean(Mq.class, "logStart")
.inOnly("activemq:topic:HUB_TOP01");

Viewing all articles
Browse latest Browse all 5648

Trending Articles