Skip to content

Tag: kafka-consumer-api

How to run consumer @StreamListener only after ApplicationReadyEvent method completed?

I have a consumer method with And I have a method with an event listener Is it possible to configure @StreamListener to start listening only after @EventListener method is completed? Answer According to Spring Cloud Stream docs you could use property<bindingName>.consumer.autoStartup=false which will stop BindingService from starting automatically starting consumer binding. Then you can do it yourself whenever you

The Kafka topic is here, a Java consumer program finds it, but lists none of its content, while a kafka-console-consumer is able to

It’s my first Kafka program. From a kafka_2.13-3.1.0 instance, I created a Kafka topic poids_garmin_brut and filled it with this csv: And at anytime now, before or after running the program I’ll show, its content can be displayed by a kafka-console-consumer command: Here is the Java program, based on org.apache.kafka:kafka-streams:3.1.0 dependency, extracting this topic as a stream: But, while the

Strategy to choose when doing Serialization and Deserialization using spring-kafka library

I need to Serialize or Deserialize any type of Java Object may be Integer/ String or <T> or User or Account in my project. There might be more than 1 type I am not sure which one to use while configuring a Kafka Producer and Consumer. There are JsonSerializer and JsonDeserializer and StringSerializer/DESer and many more types. I have read