What would be the easiest way to implement GZIP compression decorators on JacksonSerializer
for Events
and Messages
in Axon? I'm trying to GZIP JSON messages before saving events to MySQL as BLOB.
I tried implementing decorator like this:
public class GzipSerializer implements Serializer {
private Serializer serializer;
...
and then configuring it using:
@Autowired
public void serializerConfiguration(Configurer configurer) {
Serializer defaultSerializer = new GzipSerializer(JacksonSerializer.defaultSerializer());
configurer.configureSerializer(configuration -> defaultSerializer)
.configureMessageSerializer(configuration -> defaultSerializer)
.configureEventSerializer(configuration -> defaultSerializer);
}
but it does not seem to work. Is there maybe some easier way (or possibly already implemented functionality)?