I am using spring-cloud-stream-binder-kafka version 3.2.6 in my application. I have enabled the batch-mode so that I should get the messages in batches. While handling DLQ scenario I observed that, In my batch if I have 3 messages and if my last message fail then entire batch goes to DLQ. Although I am throwing BatchListenerFailedException with the correct index of the message that has failed.
After debugging further I observed in Class org.springframework.cloud.stream.binder.kafka KafkaMessageChannelBinder method getErrorMessageHandler throws ClassCastException (Can not cast LinkedList to ConsumerRecord). Below is that line.
Method StaticMessageHeaderAccessor.getSourceData(message) returns list of ConsumerRecord but in the code it is expecting single consumer record. Is this a bug? If not can somebody help me to find how to resolve this issue.
Ignore this issue. It was a configuration issue from my side. I have batch-mode enabled and I have enabled enableDLQ as well. After disabling enableDLQ it worked
I am using spring-cloud-stream-binder-kafka version 3.2.6 in my application. I have enabled the batch-mode so that I should get the messages in batches. While handling DLQ scenario I observed that, In my batch if I have 3 messages and if my last message fail then entire batch goes to DLQ. Although I am throwing BatchListenerFailedException with the correct index of the message that has failed.
After debugging further I observed in Class org.springframework.cloud.stream.binder.kafka KafkaMessageChannelBinder method getErrorMessageHandler throws ClassCastException (Can not cast LinkedList to ConsumerRecord). Below is that line.
https://github.com/spring-cloud/spring-cloud-stream-binder-kafka/blob/31ea10683422d38d8185c6b236b8954200562b77/spring-cloud-stream-binder-kafka/src/main/java/org/springframework/cloud/stream/binder/kafka/KafkaMessageChannelBinder.java#L1211
Method StaticMessageHeaderAccessor.getSourceData(message) returns list of ConsumerRecord but in the code it is expecting single consumer record. Is this a bug? If not can somebody help me to find how to resolve this issue.
Appreciate your early response.
Thanks