I am using Apache Camel 2.14.0 to build a REST API, and am using the Rest DSL and its auto binding to POJOs, I believe this uses Jackson for (De)Serialization. Unfortunately this produces rather long and unweildy JSON from DateTime objects including fields like chronology, zone, uncachedZone, etc.
I would like it to create/consume something simpler.
I am aware from this question: How to serialize Joda DateTime with Jackson JSON processer?
That I can register the JodaModule for a Jackson ObjectMapper like so:
ObjectMapper mapper = new ObjectMapper();
mapper.registerModule(new JodaModule());
But I cannot work out or find an example of how to achieve this in Camel.
How would I go about doing this? Something in my camel context, or something completely different? I would like to avoid writing a custom (de)seralizer and having to annotate each DateTime field separately.
I do not need a custom implementation, just the simple one provided by the JodaModule.
Alternatively, if Jackson serializes a different Date/Time object better by default, I could use that.