Apache camel 骆驼+;Java DSL Fluent builder与real ActiveMQ代理

Apache camel 骆驼+;Java DSL Fluent builder与real ActiveMQ代理,apache-camel,activemq,Apache Camel,Activemq,我试图实现一个with,它给出了下面的示例代码段 from("direct:start") .to("log:foo") .wireTap("direct:tap") .to("mock:result"); 如果我运行一个模拟示例(例如,camel示例jms文件),这就可以工作。但是,如果我使用示例代码并尝试替换一个真实的代理实例和队列来替换模拟对象,它将失败,并出现以下错误 from("tcp://localhost:61616") .to("ativemq:atsUpdateQueue")

我试图实现一个with,它给出了下面的示例代码段

from("direct:start")
.to("log:foo")
.wireTap("direct:tap")
.to("mock:result");
如果我运行一个模拟示例(例如,camel示例jms文件),这就可以工作。但是,如果我使用示例代码并尝试替换一个真实的代理实例和队列来替换模拟对象,它将失败,并出现以下错误

from("tcp://localhost:61616")
.to("ativemq:atsUpdateQueue")
.wireTap("activemq:fdmCaptureQueue");
然后它失败了

org.apache.camel.FailedToCreateRouteException: Failed to create route route2: Route(route2)[[From[tcp://localhost:61616?queue=atsUpdateQue... because of Failed to resolve endpoint: tcp://localhost:61616?queue=atsUpdateQueue due to: No component found with scheme: tcp

我在谷歌上搜索了很多,发现的所有示例都使用了虚拟模拟队列,似乎没有一个示例能够说明如何使用真正的代理,但我找不到任何有关camel的URI规范的文档。

错误消息的重要部分描述了scheme:tcp未找到组件的问题,这是因为驼峰没有“tcp”组件,但是如果您想与tcp端点交互,可以使用netty组件:

from("netty:tcp://localhost:61616")
更多信息请点击此处-

“tcp://localhost:61616“看起来像activemq代理地址。 您需要在JavaDSL中设置activemq组件的代理地址

camelContext.addComponent("activemq", activeMQComponent("tcp://localhost:61616"));
或者在spring配置文件中

<bean id="activemq"
      class="org.apache.activemq.camel.component.ActiveMQComponent">
      <property name="brokerURL" value="tcp://somehost:61616"/>
</bean>


您可以找到有关camel activemq的更多信息

谢谢您的建议,这有助于增进我的理解,但实际上并没有解决我的问题。我的代码是错误的,为了他人的利益,我应该使用以下名称

    final String sourceQueue = "activemq:queue:atsUpdateQueue";
    final String destinationQueue = "activemq:queue:atsEndPoint";
    final String wiretapQueue = "activemq:queue:fdmCaptureQueue";

    from(sourceQueue).wireTap(wiretapQueue).copy().to(destinationQueue);