Perform wireTap using apache camel

十年热恋 提交于 2019-12-11 22:12:25

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!