MuleESB / Apache Camel Interview Questions
What is the Message in Camel (body, headers, attachments) and the difference between In and Out messages?
A Camel Message (org.apache.camel.Message) is the envelope carried inside an Exchange. It has three parts: body (any Java object — String, byte[], InputStream, POJO, DOM — type-converted transparently via getBody(TargetClass.class)), headers (a Map<String, Object> of metadata auto-populated by transport components), and attachments (named DataHandler objects for SOAP/MIME multipart messages).
In vs Out messages: In an InOnly exchange, only the In message exists; JMS publish, Kafka produce, and file write are InOnly by default. In an InOut exchange, the caller sends an In message and waits for a reply via the Out message; HTTP REST calls and synchronous direct: calls use InOut.
In Camel 3.x, the idiomatic reply approach is to mutate exchange.getIn() with the response body rather than writing to exchange.getOut(). Calling getOut() creates a fresh Message and silently discards all headers set by prior processors — a common source of bugs during Camel 3.x migrations.
Invest now in Acorns!!! 🚀
Join Acorns and get your $5 bonus!
Acorns is a micro-investing app that automatically invests your "spare change" from daily purchases into diversified, expert-built portfolios of ETFs. It is designed for beginners, allowing you to start investing with as little as $5. The service automates saving and investing. Disclosure: I may receive a referral bonus.
Invest now!!! Get Free equity stock (US, UK only)!
Use Robinhood app to invest in stocks. It is safe and secure. Use the Referral link to claim your free stock when you sign up!.
The Robinhood app makes it easy to trade stocks, crypto and more.
Webull! Receive free stock by signing up using the link: Webull signup.
More Related questions...
