Looks like I've managed to fix this, with some help from this post on
StackOverflow:

https://stackoverflow.com/questions/33397359/how-to-configure-jackson-objectmapper-for-camel-in-spring-boot

What I did is to create a new ObjectMapper instance and disabled the
SerializationFeature.FAIL_ON_EMPTY_BEANS feature:

private static ObjectMapper getCustomObjectMapper() {
    ObjectMapper om = new ObjectMapper();
    om.disable(SerializationFeature.FAIL_ON_EMPTY_BEANS);
    return om;
}

I then added this instance to the JNDI registry using the name "json-jackson":

registry.bind("json-jackson", getCustomObjectMapper());

This code is executed in the CameContextLifecycle.beforeStart method.

I also had to modify the Content-Type of the request to text/plain so
that the message text was included in the email body rather than as an
attachment.

Reply via email to