简体   繁体   English

将此骆驼路线片段从Java DSL转换为Blueprint xml

[英]Translate this camel route snippet from Java DSL to Blueprint xml

Does anyone know how to write this camel route snippet in blueprint xml's sytax? 有谁知道如何在blueprint xml的sytax中编写此骆驼路线代码段?

.setHeader("headerName").method(beanInstance, "methodToGetHeaderValue")

I assume it's something like this but I can't get the exact syntax down. 我以为是这样,但我无法掌握确切的语法。

<setHeader headerName="theHeader"> 
    <bean id="beanId" ref="MyBean" method="BeanMethod"/> 
</setHeader>

Thanks! 谢谢!

I think the tag you're looking for to invoke a method is <method> . 我认为您要查找的用于调用方法的标签是<method>

The Camel docs have an example of setting a header and invoking a method . Camel文档中有一个设置标头调用方法的示例。 Putting these together, you get: 将它们放在一起,您将获得:

<setHeader headerName="theHeader">
  <method ref="MyBean" method="methodToGetHeaderValue" />
</setHeader>

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

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