我正在尝试用Spring路由骆驼。我无法把这条消息送到目的地。我知道我错过了什么,请帮我解决这个问题。我已经在deviceMessageRouteIdentifier中设置了如下标题
Message outMsg = exchange.getOut();
outMsg.setHeader("device_template_id","11");
outMsg.setHeader("view_id", "2");
我的骆驼路线在这里
<camel:route>
<camel:from uri="direct:devicemessageprocessor"/>
<camel:bean ref="deviceMessageRouteIdentifier"/>
<camel:to uri="seda:deviceRouting"/>
</camel:route>
<camel:route>
<camel:from
uri="seda:deviceRouting?concurrentConsumers=10&blockWhenFull=true&purgeWhenStopping=true" />
<choice>
<when>
<header>$device_template_id = '11'</header>
<to uri="direct:gen2Bridge" />
</when>
<when>
<header>$view_id = '1'</header>
<to uri="direct:prediction" />
</when>
</choice>
</camel:route>
<camel:route>
<camel:from uri="direct:gen2Bridge"/>
<camel:bean ref="gen2BridgeProcessor" />
</camel:route>
我可以到达deviceMessageRouteIdentifier,但不能到达目的地gen2BridgeProcessor
提前感谢
发布于 2015-09-27 14:22:36
您应该使用简单的语言作为谓词,而不是头。标头只用于查找标头值。
<header>$device_template_id = '11'</header>
应该是
<simple>${header.device_template_id} == '11'</simple>
等号运算符是==
。有关更多细节,请参见简单语言。
https://stackoverflow.com/questions/32798787
复制相似问题