How do I convert my BeanInvocation object in camel to a message body and headers?

一个人想着一个人 提交于 2019-12-23 21:09:02

问题


I'm using Camel Proxy to expose an interface as a starting point for a route. It uses a BeanInvocation object as the message body. How do I set the message body and headers based on the arguments passed to the interface?

public interface test{
   public void sayHi(String firstName, String lastName);
}

I'd like to make the body (firstName + " " + lastName). I'd also like to know how to set one argument as a header on the message and the other as the body.


回答1:


It uses the same bean parameter binding stuff that regular Camel bean invocations uses. So check out the documentation about this

http://camel.apache.org/bean-integration.html

Camel in Action chapter 4 covers all about using beans with Camel.



来源:https://stackoverflow.com/questions/3397591/how-do-i-convert-my-beaninvocation-object-in-camel-to-a-message-body-and-headers

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!