问题
I need to do wireTap using camel.
Below is the piece of code I have written
from("jetty:http://xyz:8080?enableMultipartFilter=false")
.streamCaching()
.wireTap("direct:tap").copy(true).process(new WireTapProcessor()).end()
.process(new RequestProcessor())
.to("file:Z:/Testing/input");
When executing above code, it gives me exception that NoDirectConsumersAvailable.
Could you please suggest how to perform wireTap in above scenario
回答1:
Well you send the Wire Tap to a direct consumer but you dont create a direct consumer route or in other words you never define the other route to handle the wire tap. I use seda queues here instead of direct queues.
Try the following:
from("jetty:http://xyz:8080?enableMultipartFilter=false")
.streamCaching()
.wireTap("seda:wiretapqueue")
.process(new RequestProcessor())
.to("file:Z:/Testing/input");
from("seda:wiretapqueue").to("somecomponent:foo");
This should resolve your issue. Also see this link
来源:https://stackoverflow.com/questions/21691476/perform-wiretap-using-apache-camel