我遇到了一些與駱駝路由的問題。這是我的配置文件,很簡單:amqp和駱駝錯誤:路由沒有輸入
<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&destination.consumer.prefetchSize=50"/>
<to uri="stream:out"/>
</route>
</camel:route>
</camel:camelContext>
在這種情況下,我使用RabbitMQ,hello是隊列名稱。
運行它,我得到這個錯誤信息:
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的樣本或教程?
---修訂---
繼下面的評論的建議,我固定的配置和一點點領先一步已經完成。現在,似乎能夠連接到隊列,但是,如果我嘗試寫我得到「camelContext必須指定」異常
<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>
感謝,
安德烈
只是一個簡單的問題。你在談論駱駝+ RabbitMQ還是Camel + ActiveMQ? –
我正在嘗試用戶Camel + RabbitMQ –
Camel中的ActiveMQ組件無法用於連接到RabbitMQ,因爲它們說不同的協議。對於RabbitMQ,您應該使用AMQP組件。 –