Sample Spring Cloud Stream Kafka Consumer
Run following commands & Run Consumer without group id
mvn clean install
mvn spring-boot:run -Dspring.cloud.stream.kafka.binder.brokers=<KAFKA_BROKER_URL> -Dspring.cloud.stream.bindings.input.destination=<TOPIC_NAME>
Steps to reproduce kafka-binder-issue:
- Once the application starts, send some messages on the kafka topic you provided.
- Stop the application & send some more messages on the kafka topic.
- Run the application again by providing a fresh consumer group id and consumer startOffset (value latest).
- Notice that it does not listen to the messages which were sent between the stop (consumer without group id) & start (consumer with new group id) phase.
- Run the below command to build the docker image
mvn clean install
docker build . -t consumer
- Run the src/main/docker/docker-compose-consumer.yml file with the following command
docker-compose -f docker-compose-consumer.yml up
- Send some messages on the kafka topic you provided.
- Stop the application & send some more messages on the kafka topic.
- Run the application again by uncommenting last 2 lines of the docker-compose file's environment section. (group id & startOffset).
- Notice that it does not listen to the messages which were sent between the stop (consumer without group id) & start (consumer with new group id) phase.