views:

29

answers:

1

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.

A: 

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.

Claus Ibsen
All the documentation and the chapters in the book cover routing to a bean. I'm trying to start a route with a bean and get the body and headers like I want them. I've added several javascript routes to map my arguments to headers and the body. It just feels dirty. I'm trying to figure out the best way to do this.
ScArcher2