Assume I have the route as follows
from("direct:A")
.process(new ProcessA())
.setHeader(Exchange.HTTP_METHOD, "get")
.recipientList( simple(httpUri + header("doc_id")), "false")
.process(new ProcessB())
.to("direct:B");
In the above path httpUri = "http4://localhost:25600". Now I am trying to intercept the message as follows.
context.getRouteDefinitions().get(0).adviceWith(context, new AdviceWithRouteBuilder() {
@Override
public void configure() throws Exception {
interceptSendToEndpoint("http4*")
.skipSendToOriginalEndpoint()
.process(new Processor() {
@Override
public void process(Exchange exchange) throws Exception {
//TODO
}
});
}
});
The problem here is that the exchange is not being intercepted and context is actually trying to make a connection with httpUri host even there is skipSendToOriginalEndpoint.
Please let me know if there is anything wrong in the code. Thanks in advance.