简体   繁体   English

骆驼Java-DSL:在to()中使用标头

[英]Camel Java-DSL: Using header in to()

I'm trying to setup my routes and have the problem, that a processor had to choose the 'next working queue'. 我正在尝试设置路由,但遇到了问题,即处理器必须选择“下一个工作队列”。 He did this and wrote it to the header. 他这样做并将其写到标题中。

Now I would like to use it in my route: 现在,我想在路线中使用它:

...
.bean(MyProcessor.class, "doSomething") //
.to("${headers.NEXT_QUEUE}") //
.log("Finished");
...
from(...)....

Is there a way to do this. 有没有办法做到这一点。

Is this even possible, as the RouteBuilder has to work here with a 'placeholder'? 这是可能的吗,因为RouteBuilder必须在这里使用“占位符”?

Sry, I'm new to Camel. 对不起,我是骆驼的新手。

See this FAQ http://camel.apache.org/how-do-i-use-dynamic-uri-in-to.html 请参阅此常见问题解答http://camel.apache.org/how-do-i-use-dynamic-uri-in-to.html

You need to use the recipient list EIP pattern for dynamic to. 您需要使用收件人列表EIP模式进行动态更改。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM