Parent
#1 — Migrate domain event bus from RabbitMQ to Kafka
What to build
Full producer path: when CourseCreator creates a Course, the CourseCreatedDomainEvent is published to the "course.created" Kafka topic. The KafkaEventBus replaces RabbitMqEventBus as the primary EventBus implementation and falls back to MySqlEventBus on persistent KafkaException after producer retries are exhausted.
Domain events are serialized to a JSON envelope (data/id/type/occurred_on/attributes) using a Jackson mix-in at the infrastructure level — no Jackson annotations on domain classes, no reflection, no toPrimitives() or fromPrimitives().
The DomainEvent base class is simplified (remove toPrimitives(), toJson(), fromPrimitives(), implements Serializable), CourseCreatedDomainEvent loses its no-arg constructor and serialization boilerplate, and the @DomainEventSubscriber annotation is deleted.
All RabbitMQ producer infrastructure is removed.
Acceptance criteria
Blocked by
None — can start immediately
Parent
#1 — Migrate domain event bus from RabbitMQ to Kafka
What to build
Full producer path: when
CourseCreatorcreates aCourse, theCourseCreatedDomainEventis published to the"course.created"Kafka topic. TheKafkaEventBusreplacesRabbitMqEventBusas the primaryEventBusimplementation and falls back toMySqlEventBuson persistentKafkaExceptionafter producer retries are exhausted.Domain events are serialized to a JSON envelope (
data/id/type/occurred_on/attributes) using a Jackson mix-in at the infrastructure level — no Jackson annotations on domain classes, no reflection, notoPrimitives()orfromPrimitives().The
DomainEventbase class is simplified (removetoPrimitives(),toJson(),fromPrimitives(),implements Serializable),CourseCreatedDomainEventloses its no-arg constructor and serialization boilerplate, and the@DomainEventSubscriberannotation is deleted.All RabbitMQ producer infrastructure is removed.
Acceptance criteria
DomainEventbase class has notoPrimitives(),toJson(), orfromPrimitives()methodsCourseCreatedDomainEventhas no no-arg constructor and no serialization methodsKafkaEventBus(annotated@Primary) publishes eachDomainEventto a Kafka topic matching itseventName()KafkaEventBusfalls back toMySqlEventBuswhenKafkaTemplate.send()throws after retries"course.created"topicDomainEventKafkaSerializerunit test proves round-trip (serialize → deserialize → equal event)spring-boot-starter-amqpandcom.google.guava:guavaremoved frombuild.gradlespring-kafkaadded tobuild.gradle@DomainEventSubscriberannotation deletedNamingUtil.javadeletedRabbitMqEventBusConfigurationdeletedBlocked by
None — can start immediately