Update the event handler
Change the event handler to become a spring service, as this way Axon
will automatically pick it up as an event handling component
package com.baeldung.axon.eventhandlers;
-import com.baeldung.axon.events.MessageReadEvent;
-import com.baeldung.axon.events.MessageCreatedEvent;
import org.axonframework.eventhandling.EventHandler;
+import org.springframework.stereotype.Service;
+import com.baeldung.axon.events.MessageCreatedEvent;
+import com.baeldung.axon.events.MessageReadEvent;
+@Service
public class MessagesEventHandler {
@EventHandler
