0
我是新來的駱駝,我試圖建立一個非常簡單的應用程序來適應它,我運行下面的代碼:駱駝;簡單SEDA到豆路線行不通
CamelContext cc = (CamelContext)ac.getBean("testCamelContext");
ProducerTemplate template = cc.createProducerTemplate();
System.out.println("Sending Message Body");
template.sendBody("seda:testProducer", "hello");
System.out.println("Sent");
,哪個跑得不錯,但我的消費者似乎從來沒有拿起消息,我得到的控制檯執行以下操作:使用下面的駱駝背景
[ main] SpringCamelContext INFO Apache Camel 2.10.2 (CamelContext: testCamelContext) is starting
[ main] ManagementStrategyFactory INFO JMX enabled.
[ main] DefaultTypeConverter INFO Loaded 172 type converters
[ main] SpringCamelContext INFO Route: route1 started and consuming from: Endpoint[seda://testProducer]
[ main] ultManagementLifecycleStrategy INFO StatisticsLevel at All so enabling load performance statistics
[ main] SpringCamelContext INFO Total 1 routes, of which 1 is started.
[ main] SpringCamelContext INFO Apache Camel 2.10.2 (CamelContext: testCamelContext) started in 0.373 seconds
Init Context
SendingMessage
Sending Message Body
Sent
:
<camel:camelContext id="testCamelContext">
<camel:routeBuilder ref="testCamelRouteBuilder"/>
</camel:camelContext>
而且RouteBuilder規則:
from("seda:testProducer").beanRef("testConsumer","consumeMessage");
而下面的消費者豆:
public class TestConsumer {
public void consumeMessage(String msg)
{
System.out.println("Message: " + msg);
}
}
所有的豆類都是精品和駱駝似乎檢測規則確定,所以我不知道我做了什麼錯。我顯然沒有正確使用某些東西?