使用apache camel执行wireTap

时间:2014-02-11 01:44:51

标签: apache-camel

我需要使用camel做wireTap。

以下是我编写的代码

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");

执行上面的代码时,它给了我NoDirectConsumersAvailable。

的例外

您能否建议如何在上述场景中执行wireTap

1 个答案:

答案 0 :(得分:0)

您将Wire Tap发送给直接消费者,但是您没有创建直接的消费者路线,换句话说,您从未定义其他路线来处理电话线。我在这里使用seda队列而不是直接队列。

尝试以下方法:

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 link

相关问题