Axon 4.3 - consume message from topic kafka

Hello everybody,

I have a problem with this consumer, i can’t consume the message from the topic.

Do you have any idea?

`

org.springframework.boot
spring-boot-starter-web

org.axonframework axon-spring-boot-starter 4.3 org.axonframework axon-server-connector org.springframework.kafka spring-kafka `

`
axon:
eventhandling:
processors:
conventions:
source: kafkaMessageSource
mode: tracking
serializer:
general: jackson
kafka:
client-id: consumer_service
default-topic: topic_x
bootstrap-servers:

  • 127.0.0.1:9092
    `

`
@SpringBootApplication(exclude = org.springframework.boot.autoconfigure.kafka.KafkaAutoConfiguration.class)
public class DemoApplication {

public static void main(String[] args) {
SpringApplication.run(DemoApplication.class, args);
}

}
`

`
//@Component
@ProcessingGroup(value = “conventions”)
public class GenericListener {

private static final Logger LOGGER = LoggerFactory.getLogger(GenericListener.class);

@EventHandler
void on(ConventionCreatedEvent event) {
LOGGER.info(“got the event {}”, event);
}

}
`

i have this dependency too

<dependency> <groupId>org.axonframework.extensions.kafka</groupId> <artifactId>axon-kafka-spring-boot-starter</artifactId> <version>4.0-RC3</version> </dependency>

Hi Aymen,

The GenericListener is likely not receiving anything as it’s not a Spring managed bean.
When using the Axon’s Spring Boot starter you want your Message Handling Components, like the GenericListener, to be part of the application context.
That way Axon will know to configure it within an Event Processor.

Cheers,
Steven

PS. The Axon Kafka Extension contains a sample project showing how to use it. Might come in handy to deduce what’s going wrong in your own set up.