sanre6
sanre6

Reputation: 807

How to send serialized java objects via apache camel?

We use Message or Exchange to set the outbound message . the only method these provide is

exchange.getOut.setBody();

if i do something like setBody(new Object())..it doesn't work

so how do we send java objects via camel exchange.

Upvotes: 1

Views: 1779

Answers (1)

Claus Ibsen
Claus Ibsen

Reputation: 55540

And setting a payload as new Object() just means you send an empty object. And if you want serialized objects, then you object must be serializable such as implementing java.io.Serializable

And where do you route the message afterwards?

Upvotes: 3

Related Questions