We are using Coda Hale metrics in our application, with the Json module add-on to improve the JSON output of some REST services exposing the application metrics.
Recently, we started saving the metrics to MongoDB. As we are using spring-data-mongodb, the code to save POJOs is greatly simplified. Spring's MongoDB type mapping uses the usual approach (introspection of the bean properties to figure out what to save and read), however this does not play well with Code Hale objects (Timer, Counter, etc).
If we could make Spring use the JSON module already available for Jackson, that would be great, as we would be having the save serialization style and little code to maintain.
However after reading the docs and browsing some Spring mongodb source files, I can't find a straightforward to inject a custom Jackson serializing. It seems that the only way to customize the process is creating a custom MongoTypeMapper.
Does anyone know if we can inject a custom Jackson mapper, or can recommend an alternative solution?
Thanks