【发布时间】:2014-08-22 20:06:54
【问题描述】:
我想要做的是有一个“jms”队列,它发送一条消息,正文包含一个文件的名称和一个表示切换到的路由的“标题”(例如 JMSType)。切换路由后(使用“直接:”),我希望能够使用消息正文中指示的文件,但我不知道如何正确执行。这就是我的意思(在一种伪代码中):
from('jms:whatToDo')
.choice().header('JMSType')
.when('this').to('direct:this')
.when('that').to('direct:that')
.otherwise().to('direct:nothing')
.end()
from ('direct:this').from('file:/tmp/${jms-body()}?noop=true')
.split(body().tokenize('\n'))...etc
我已经连续放置了 2 个 "from"s ("direct:" 和 "file:") 在骆驼中是错误的,但这是为了突出我的意思。
知道如何使用 Camel 实现这一目标吗?
【问题讨论】:
标签: jms apache-camel