You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In what version(s) of Spring for Apache Kafka are you seeing this issue?
3.2.0
Describe the bug
When using the @RetryableTopic annotation on a Listener that returns a CompletableFuture, no retry or dlt events are sent when the CompletableFuture completes with an exception.
To Reproduce
@RetryableTopic(
attempts = "5",
kafkaTemplate = "retryTemplate",
autoCreateTopics = "false",
backoff = @Backoff(delay = 6000)
)
@KafkaListener(
topics = "my-test-topic",
properties = {
"key.deserializer=io.confluent.kafka.serializers.KafkaAvroDeserializer",
"value.deserializer=io.confluent.kafka.serializers.KafkaAvroDeserializer",
"specific.avro.reader=true"
},
id = "myId"
)
public CompletableFuture<Void> receive(ConsumerRecord<Key, Value> record) {
log.info("Received request (id {}) on topic {}", record.key().getId(), record.topic());
CompletableFuture<Void> result = processor.process(record.key(), record.value());
result.whenComplete((v, ex) -> {
if (ex != null) {
log.error("Error processing request: {}", ex.getMessage());
}
});
return result;
}
Expected behavior
A CompletableFuture, which results in an exception, should be retried with the given properties and marked for ack on my-topic.
The text was updated successfully, but these errors were encountered:
@matthiasValuecloud This is not a bug, but something we never added as a feature for non-blocking retries with async KafkaListener methods. We can try to make it in before the next releases, but any PR contributions are welcome. Thanks!
Well i can try, but i am really not comfortable around such a huge project and how to contribute properly. I will read through the guidelines and see what i can do :D
In what version(s) of Spring for Apache Kafka are you seeing this issue?
3.2.0
Describe the bug
When using the
@RetryableTopic
annotation on a Listener that returns aCompletableFuture
, no retry or dlt events are sent when theCompletableFuture
completes with an exception.To Reproduce
Expected behavior
A
CompletableFuture
, which results in an exception, should be retried with the given properties and marked for ack on my-topic.The text was updated successfully, but these errors were encountered: