spring-modulith icon indicating copy to clipboard operation
spring-modulith copied to clipboard

Add Spring Cloud Stream Event Externalization support

Open ivangsa opened this issue 9 months ago • 1 comments
trafficstars

This pull request adds support for Spring Cloud Stream Externationalization, including serializers/deserializers for Message<?> (generics deserialization) and Avro Playloads.

New Module Addition:

  • Added spring-modulith-events-scs module to the pom.xml file.

Documentation:

  • README.md for the new spring-modulith-events-scs module, detailing its purpose, usage, dependencies, configuration, and event routing.
  • The contents of this README.md file can be moved to proper documentation if this PR progresses.

Implementation:

  • MessageEventSerializer classes for event serialization of generic Message<?> keeping payload type. [1]
  • AvroEventSerializer classes for event serialization of Avro Paylods, since Jackson ObjectMapper does not handle well Avro Specific/GenericRecords. [2]
    • It works both for Avro events or Message with Avro payloads
  • SpringCloudStreamEventExternalizer class to handle event externalization using Spring Cloud Stream.
  • EnableSpringCloudStreamEventExternalization annotation for enabling the event externalization configuration.

Testing

  • Testing coverage is 89.2% and 75% for branches coverage
  • There is also a playground proyect showcasing the use of Spring Cloud Stream Externationalization with Avro support: https://github.com/EDALearn/EDA-TransactionalOutbox-Modulith-JPA/tree/spring-modulith-PR (branch spring-modulith-PR)

ivangsa avatar Feb 01 '25 16:02 ivangsa