Git Product home page Git Product logo

dev.shermende.kafka-dlq-retry's Introduction

Kafka DLQ retry

Quality Gate Status Maven pipeline

Workflow cycle

kafka-dlq-retry-cycle

Reference

Run

Run with docker-compose

Requirement
  • docker 19.03.8
  • docker-compose 1.25.0
Build and run
# build and run
$ docker-compose -f .dev/docker-compose-fast-start.yml -p kafka-dlq-retry-fast-start up --build -d
# show log
$ docker-compose -f .dev/docker-compose-fast-start.yml -p kafka-dlq-retry-fast-start logs -f kafka-dlq-retry

Run with java

Requirement
  • java 11
Create application.properties in project directory
# spring properties for connect to kafka
spring.kafka.producer.bootstrap-servers=kafka-host:port
spring.kafka.consumer.bootstrap-servers=kafka-host:port
# properties for define topics
dev.shermende.kafka-dlq-retry.consumers[0].topic=application.topic
dev.shermende.kafka-dlq-retry.consumers[0].dlq-topic=application.topic.dlq
dev.shermende.kafka-dlq-retry.consumers[0].error-topic=application.topic.error
# property for delay
dev.shermende.kafka-dlq-retry.consumers[0].delays=200,300,400
# property for concurreny and multithreading
dev.shermende.kafka-dlq-retry.consumers[0].concurrency=5
Build and run
# build 
$ ./mvnw clean package
# run
$ java -jar target/application.jar

Troubleshooting

Problem
org.apache.kafka.clients.consumer.CommitFailedException: Commit cannot be completed since the group has already rebalanced and assigned the partitions to another member. This means that the time between subsequent calls to poll() was longer than the configured max.poll.interval.ms, which typically implies that the poll loop is spending too much time message processing. You can address this either by increasing max.poll.interval.ms or by reducing the maximum size of batches returned in poll() with max.poll.records.
Cure
increase 'max.poll.interval.ms' in application.properties
spring.kafka.consumer.properties.max.poll.interval.ms=300000{+ ms}
OR
reduce 'max.poll.records' in application.properties
spring.kafka.consumer.properties.max.poll.records=500{- reduced row count}

dev.shermende.kafka-dlq-retry's People

Contributors

shermende avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.