File tree Expand file tree Collapse file tree 2 files changed +9
-15
lines changed
main/java/org/springframework/kafka/listener
test/java/org/springframework/kafka/annotation Expand file tree Collapse file tree 2 files changed +9
-15
lines changed Original file line number Diff line number Diff line change @@ -37,22 +37,28 @@ public interface ConsumerSeekAware {
3737 * containers listeners should store the callback in a {@code ThreadLocal}.
3838 * @param callback the callback.
3939 */
40- void registerSeekCallback (ConsumerSeekCallback callback );
40+ default void registerSeekCallback (ConsumerSeekCallback callback ) {
41+ // do nothing
42+ }
4143
4244 /**
4345 * When using group management, called when partition assignments change.
4446 * @param assignments the new assignments and their current offsets.
4547 * @param callback the callback to perform an initial seek after assignment.
4648 */
47- void onPartitionsAssigned (Map <TopicPartition , Long > assignments , ConsumerSeekCallback callback );
49+ default void onPartitionsAssigned (Map <TopicPartition , Long > assignments , ConsumerSeekCallback callback ) {
50+ // do nothing
51+ }
4852
4953 /**
5054 * If the container is configured to emit idle container events, this method is called
5155 * when the container idle event is emitted - allowing a seek operation.
5256 * @param assignments the new assignments and their current offsets.
5357 * @param callback the callback to perform a seek.
5458 */
55- void onIdleContainer (Map <TopicPartition , Long > assignments , ConsumerSeekCallback callback );
59+ default void onIdleContainer (Map <TopicPartition , Long > assignments , ConsumerSeekCallback callback ) {
60+ // do nothing
61+ }
5662
5763 /**
5864 * A callback that a listener can invoke to seek to a specific offset.
Original file line number Diff line number Diff line change @@ -1689,18 +1689,6 @@ public void registerSeekCallback(ConsumerSeekCallback callback) {
16891689 this .seekCallBack .set (callback );
16901690 }
16911691
1692- @ Override
1693- public void onPartitionsAssigned (Map <org .apache .kafka .common .TopicPartition , Long > assignments ,
1694- ConsumerSeekCallback callback ) {
1695- // NOSONAR
1696- }
1697-
1698- @ Override
1699- public void onIdleContainer (Map <org .apache .kafka .common .TopicPartition , Long > assignments ,
1700- ConsumerSeekCallback callback ) {
1701- // NOSONAR
1702- }
1703-
17041692 }
17051693
17061694 interface IfaceListener <T > {
You can’t perform that action at this time.
0 commit comments