AMQP和骆驼错误:路径没有输入 [英] amqp and camel error: route has no input

查看:348
本文介绍了AMQP和骆驼错误:路径没有输入的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一些问题,我的溃败与骆驼。这是我的配置文件,很简单的:

I'm having some problems with my rout with Camel. This is my configuration file, very simple:

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

<camel:camelContext xmlns="http://camel.apache.org/schema/spring">

    <jmxAgent id="agent" createConnector="false" disabled="true"/>

    <camel:route>
        <route>
            <from uri="activemq:hello?destination.consumer.exclusive=true&amp;destination.consumer.prefetchSize=50"/>
            <to uri="stream:out"/>
        </route>
    </camel:route>
</camel:camelContext>

在这种情况下,我使用的RabbitMQ和你好是队列名称。

In this case there I'm using RabbitMQ and hello is the queue name.

运行它,我得到这个错误信息:

Running it, I get this error message:

Invocation of init method failed; nested exception is java.lang.IllegalArgumentException:  Route has no inputs: Route[[] -> [Route[[From[activemq:hello?destination.consumer.exclusive=true&destination.consumer.prefetchSize=50]] -> [To[stream:out]]]]]

你知道吗?我在哪里可以得到一个样品或骆驼+ RabbitMQ的教程?

Any idea? Where can I get a sample or a tutorial for Camel + RabbitMQ ?

--- ---修订

继下面的评论的建议,我固定的配置和一点点领先一步已经完成。现在,它似乎能够连接到队列,但如果我尝试写我得到camelContext必须指定异常

Following the suggestion on below comment, I fixed the configuration and a little step ahead has been done. Now it's seem to be able to connect to queue but, if I try to write I get "camelContext must be specified" exception

<bean id="messageConverter" class="amqp.spring.converter.XStreamConverter"/>

<rabbit:connection-factory id="connectionFactory" host="10.211.55.20" port="5672" />
<rabbit:template id="amqpTemplate" connection-factory="connectionFactory" message-converter="messageConverter" exchange="amq.fanout" />
<rabbit:admin connection-factory="connectionFactory"/>
<rabbit:queue name="hello"  />

<camel:camelContext xmlns="http://camel.apache.org/schema/spring">
    <camel:route>
        <camel:from uri="file:src/data?noop=true" />
        <camel:log message="Log!"/>
        <camel:to uri="spring-amqp:amq.fanout:hello"/>
    </camel:route>
</camel:camelContext>

感谢,

安德烈

thanks,
Andrea

推荐答案

有两个错误。首先,XML似乎缺少的路线命名空间:

There are two error. First, the XML seems to be missing namespaces on the route:

<camel:route>
   <route>
        <from uri="activemq:hello?destination.consumer.exclusive=true&amp;destination.consumer.prefetchSize=50"/>
        <to uri="stream:out"/>
    </route>

应该是:

<camel:route>
   <camel:route>
        <camel:from uri="activemq:hello?destination.consumer.exclusive=true&amp;destination.consumer.prefetchSize=50"/>
        <camel:to uri="stream:out"/>
    </camel:route>

然后,RabbitMQ的不是此刻与ActiveMQ的真兼容。的ActiveMQ 5.8版似乎支持它的RabbitMQ使用AMQP协议,但是否会在骆驼组成部分,或者支持这将是兼容的RabbitMQ是另一个问题。我不知道。

Then, RabbitMQ is not really compatible with ActiveMQ at the moment. Version 5.8 of ActiveMQ seems to support the AMQP protocol which RabbitMQ uses, but if it will be supported in the Camel component or if it will be compatible with RabbitMQ is another question. I don't know.

有在骆驼的AMQP组成部分,也是。它使用Apache QPID客户端和我还没有与RabbitMQ的运行它的运气。如果你挖使用一些上特有的版本等深跌(http://www.rabbitmq.com/interoperability.html)它可能工作在一定程度上。

There is an AMQP component in Camel as well. It's using the Apache QPID client and I have not had any luck running it with RabbitMQ. It might work to some extent if you dig deep down in using the some speific versions etc. (http://www.rabbitmq.com/interoperability.html).

这篇关于AMQP和骆驼错误:路径没有输入的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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