-
Notifications
You must be signed in to change notification settings - Fork 1.7k
GH-3276: Support async retry with @RetryableTopic #3523
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 10 commits
eee3515
fdc59f0
87ac522
723cc18
ac110b4
e30319d
6399b81
4a4a1ee
08e7721
c0fea39
e74072c
645d7ce
0c89c92
3f6b447
01de80e
97f05be
d219037
e8378da
967a7c4
f2c67c7
56e6fd3
5e70c76
1d9f7b9
e418b10
002aaf4
3b79d59
82ecac7
0afae4e
796397f
4e89d53
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| /* | ||
| * Copyright 2015-2019 the original author or authors. | ||
| * Copyright 2015-2024 the original author or authors. | ||
|
||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
|
|
@@ -16,6 +16,8 @@ | |
|
|
||
| package org.springframework.kafka.listener; | ||
|
|
||
| import java.util.function.BiConsumer; | ||
|
|
||
| import org.apache.kafka.clients.consumer.ConsumerRecord; | ||
|
|
||
| /** | ||
|
|
@@ -26,8 +28,13 @@ | |
| * | ||
| * @author Marius Bogoevici | ||
| * @author Gary Russell | ||
| * @author Sanghyeok An | ||
| */ | ||
| @FunctionalInterface | ||
| public interface MessageListener<K, V> extends GenericMessageListener<ConsumerRecord<K, V>> { | ||
|
|
||
| default void setCallbackForAsyncFailure( | ||
artembilan marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| BiConsumer<ConsumerRecord<K, V>, RuntimeException> asyncRetryCallback) { | ||
| // | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| /* | ||
| * Copyright 2018-2023 the original author or authors. | ||
| * Copyright 2018-2024 the original author or authors. | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
|
|
@@ -20,6 +20,7 @@ | |
| import java.time.Clock; | ||
| import java.time.Instant; | ||
| import java.util.Optional; | ||
| import java.util.function.BiConsumer; | ||
|
|
||
| import org.apache.kafka.clients.consumer.Consumer; | ||
| import org.apache.kafka.clients.consumer.ConsumerRecord; | ||
|
|
@@ -43,6 +44,7 @@ | |
| * @param <K> the record key type. | ||
| * @param <V> the record value type. | ||
| * @author Tomaz Fernandes | ||
| * @author Sanghyeok An | ||
| * @since 2.7 | ||
| * | ||
| */ | ||
|
|
@@ -143,4 +145,9 @@ public void onMessage(ConsumerRecord<K, V> data, Acknowledgment acknowledgment) | |
| public void onMessage(ConsumerRecord<K, V> data, Consumer<?, ?> consumer) { | ||
| onMessage(data, null, consumer); | ||
| } | ||
|
|
||
|
||
| @Override | ||
| public void setCallbackForAsyncFailure(BiConsumer<ConsumerRecord<K, V>, RuntimeException> callbackForAsyncFailureQueue) { | ||
| this.delegate.setCallbackForAsyncFailure(callbackForAsyncFailureQueue); | ||
| } | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.