Message body null for Camel REST/post endpoint
Issue
When posting JSON to a Camel Rest endpoint, attempting to retrieve an object from the Message results in a null object:
Message msg = (Message) exchange.getIn();
if(msg != null) {
MyTest testObj = msg.getBody(MyTest.class);
if(testObj == null) {
logger.warn("my test object was null!");
}
}
Environment
- Red Hat Jboss Fuse
- 6.x
- Camel
- 2.15.1
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
