We use the Coda Hale metrics in our application with a Json module add-in to improve some JSON output with REST services that display application metrics.
Recently, we started saving metrics to MongoDB. Since we use spring -data-mongodb, the code for saving POJOs is greatly simplified. Spring MongoDB type mapping uses the usual approach (introspection of bean properties to figure out what to save and read), however this does not work very well with Code Hale objects (Timer, Counter, etc.).
If we could use the Spring JSON module already available for Jackson, that would be great, since we would have a save serialization style and a little support code.
However, after reading the documents and looking at some of the Spring mongodb source files, I can't find a simple way to introduce Jackson's custom serialization. It seems that the only way to customize the process is to create a custom MongoTypeMapper.
Does anyone know if we can introduce a custom Jackson calculator or can we recommend an alternative solution?
thanks
source
share