I am not able to find how to do custom error handling in for a spring kafka consumer. My requirement is: For any deserialization errors, just write the error and message to database. For any errors in execution under @KafkaListener method, retry 3 times and then write the error and message to database. From the spring docs, I found that,
Tag: spring-kafka
How to gracefully shutdown spring-kafka consumer application
i have implemented spring-kafka consumer application. i wants consumer application graceful shutdown. the current consumer application is terminated with the Linux command kill -9 pid i am using @KafkaListener annotation now. if i quit the Spring boot app, i want to reliably close the consumer, what should i do ? i’ve been using @Predestory to reliably exit the spring boot
SpringBoot, Kafka : java.lang.NoSuchMethodError: org.apache.kafka.clients.producer.Producer.close(Ljava/time/Duration;)V
I’m using spring boot v2.2.4 and Apache Kafka in my project. Below is my pom.xml file: Below is the code which i have as part of kafka But when json message is sent to kafka queue, i’m getting below error however json message is getting reached to queue, but i want to understand why i’m getting above error looking forward
Allowed packages in custom header of Kafka-Message
In spring-kafka, how do I add classes from a package to be trusted as a custom header field? The message is being sent like this: The receiving end looks like this: The exception I keep getting is this: Caused by: org.springframework.core.convert.ConverterNotFoundException: No converter found capable of converting from type [org.springframework.kafka.support.DefaultKafkaHeaderMapper$NonTrustedHeaderType] to type [@org.springframework.messaging.handler.annotation.Header my.package.MessageType] MessageType is an enum and I
Spring Kafka, manual commiting in different threads
Good day collegues. I am using Spring Kafka 2.2.5 I have a listener: I do some operations and if they are succes i use Acknowledge interface to commit offset. I have a problem. While calculations are taking place in the created thread, the listener reads the message from the same offset again. Because of this, when i try to confirm
How to catch warning “Broker may not be available” at the Spring Kafka Listener
I am working on a POC for implementing a kafka cluster in my project. I have setup a kafka cluster in my local machine with 3 brokers. Now I am sending messages to the Kafka server using Spring MVC REST service which is internally using Spring Kafka to produce and consume messages to and from the Kafka cluster. Now i
Spring Kafka The class is not in the trusted packages
In my Spring Boot/Kafka application before the library update, I used the following class org.telegram.telegrambots.api.objects.Update in order to post messages to the Kafka topic. Right now I use the following org.telegram.telegrambots.meta.api.objects.Update. As you may see – they have different packages. After application restart I ran into the following issue: This is my config: application.properties How to solve this issue and