My project is primarily using Protobuf based requests and responses, and I’d like to replace the JacksonSerializerFactory entirely as the default factory for my services…
Ideally I’d like the ability to fall back to the JacksonSerializerFactory for messages that aren’t of my protobuf types.
So this comes down to 2 questions, first is it possible to change the default universally to a new factory, and second is it possible to chain factories, trying a second when the first fails and so on.
The ideal seems to be to somehow replace the Guice bindings to the Jackson factory, but the Guice factory injection request seems hardcoded to Jackson in most places.
As an aside, an option to specify the factory class instead of the factory instance in the descriptor seems like it should allow injecting the replacement factory and allow better configurability for custom factories.
Any thoughts, suggestions or advice are welcome.