使用 apache camel 执行 wireTap [英] Perform wireTap using apache camel

查看:96
本文介绍了使用 apache camel 执行 wireTap的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要使用骆驼进行窃听.

I need to do wireTap using camel.

下面是我写的一段代码

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 的异常.

When executing above code, it gives me exception that NoDirectConsumersAvailable.

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

Could you please suggest how to perform wireTap in above scenario

推荐答案

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

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.

尝试以下操作:

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

这篇关于使用 apache camel 执行 wireTap的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆