Message body null for Camel REST/post endpoint

Solution Verified - Updated -

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, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content