Camel - Passing specific parameters from routes to a generic bean method

后端 未结 1 1145
南笙
南笙 2021-02-05 21:48

Let\'s say I have a Camel route that looks like this :

from(\"direct:myRoute\")
        .setHeader(\"someHeader\", simple(\"some header value\"))
        .beanR         


        
1条回答
  •  花落未央
    2021-02-05 22:17

    You can pass parameters in the way you described like this:

    from("direct:myRoute")
    .setHeader("someHeader", simple("some header value"))
    .to("bean:myBean?method=beanMethod(${header.someHeader})")
    

    More info, including other methods for bean binding can be found here http://camel.apache.org/bean-binding.html

    0 讨论(0)
提交回复
热议问题