2011-12-23 118 views
0

我创建了一个包含主题名称的消息,并使用键/值对设置了一些信息并将消息发送到MessageBus(即,将消息生成为一个endPoint--在我的案例中,endpoint是一个messageBus)。如何使用Apache Camel中的端点消息?

如何消耗该终点的消息?我知道uri,终点。我的客户需要完成哪些配置(任何骆驼XML更改要完成?)。

请帮忙。

+0

注册被删除,请参见常见问题的http://小号tackoverflow.com/faq#signatures – 2011-12-23 14:20:06

+1

你可以发布你现有的路由定义吗? – 2011-12-23 18:06:00

+0

我的路由定义是test-proxy - > text-bus。该消息是到达文本总线,这是一个activeMq。我需要编写一个消费者从activeMq(它是端点)读取此消息。 – 2011-12-26 06:16:16

回答

0

看到camel-jms页的详细信息,但基本上需要做一些基本的Spring XML配置ActiveMQ的连接,然后建立你的路线......

from("activemq:queue:inboundQueue").bean(MyConsumerBean.class); 

<bean id="activemq" class="org.apache.activemq.camel.component.ActiveMQComponent"> 
    <property name="connectionFactory"> 
     <bean class="org.apache.activemq.ActiveMQConnectionFactory"> 
      <property name="brokerURL" value="vm://localhost?broker.persistent=false&broker.useJmx=false"/> 
     </bean> 
    </property> 
</bean> 

看到这些单元测试的更多信息.. 。

https://svn.apache.org/repos/asf/camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsRouteTest.java

https://svn.apache.org/repos/asf/camel/trunk/components/camel-jms/src/test/resources/org/apache/camel/component/jms/jmsRouteUsingSpring.xml

相关问题