Skip to content

Commit b57c608

Browse files
filiphrgaryrussell
authored andcommitted
Use KafkaListenerEndpoint instead of MethodKafkaListenerEndpoint in the RetryTopicNamesProvider
1 parent a372cc4 commit b57c608

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

Diff for: spring-kafka/src/main/java/org/springframework/kafka/retrytopic/RetryTopicNamesProviderFactory.java

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2021 the original author or authors.
2+
* Copyright 2021-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -16,7 +16,7 @@
1616

1717
package org.springframework.kafka.retrytopic;
1818

19-
import org.springframework.kafka.config.MethodKafkaListenerEndpoint;
19+
import org.springframework.kafka.config.KafkaListenerEndpoint;
2020

2121
/**
2222
* Handles the naming related to the retry and dead letter topics.
@@ -36,31 +36,31 @@ interface RetryTopicNamesProvider {
3636
* @param endpoint the endpoint to override
3737
* @return The endpoint id
3838
*/
39-
String getEndpointId(MethodKafkaListenerEndpoint<?, ?> endpoint);
39+
String getEndpointId(KafkaListenerEndpoint endpoint);
4040

4141
/**
4242
* Return the groupId that will override the endpoint's groupId.
4343
*
4444
* @param endpoint the endpoint to override
4545
* @return The groupId
4646
*/
47-
String getGroupId(MethodKafkaListenerEndpoint<?, ?> endpoint);
47+
String getGroupId(KafkaListenerEndpoint endpoint);
4848

4949
/**
5050
* Return the clientId prefix that will override the endpoint's clientId prefix.
5151
*
5252
* @param endpoint the endpoint to override
5353
* @return The clientId prefix
5454
*/
55-
String getClientIdPrefix(MethodKafkaListenerEndpoint<?, ?> endpoint);
55+
String getClientIdPrefix(KafkaListenerEndpoint endpoint);
5656

5757
/**
5858
* Return the group that will override the endpoint's group.
5959
*
6060
* @param endpoint the endpoint to override
6161
* @return The clientId prefix
6262
*/
63-
String getGroup(MethodKafkaListenerEndpoint<?, ?> endpoint);
63+
String getGroup(KafkaListenerEndpoint endpoint);
6464

6565
/**
6666
* Return the tropic name that will override the base topic name.

Diff for: spring-kafka/src/main/java/org/springframework/kafka/retrytopic/SuffixingRetryTopicNamesProviderFactory.java

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2021 the original author or authors.
2+
* Copyright 2021-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -16,7 +16,7 @@
1616

1717
package org.springframework.kafka.retrytopic;
1818

19-
import org.springframework.kafka.config.MethodKafkaListenerEndpoint;
19+
import org.springframework.kafka.config.KafkaListenerEndpoint;
2020
import org.springframework.kafka.support.Suffixer;
2121

2222
/**
@@ -41,22 +41,22 @@ public SuffixingRetryTopicNamesProvider(DestinationTopic.Properties properties)
4141
}
4242

4343
@Override
44-
public String getEndpointId(MethodKafkaListenerEndpoint<?, ?> endpoint) {
44+
public String getEndpointId(KafkaListenerEndpoint endpoint) {
4545
return this.suffixer.maybeAddTo(endpoint.getId());
4646
}
4747

4848
@Override
49-
public String getGroupId(MethodKafkaListenerEndpoint<?, ?> endpoint) {
49+
public String getGroupId(KafkaListenerEndpoint endpoint) {
5050
return this.suffixer.maybeAddTo(endpoint.getGroupId());
5151
}
5252

5353
@Override
54-
public String getClientIdPrefix(MethodKafkaListenerEndpoint<?, ?> endpoint) {
54+
public String getClientIdPrefix(KafkaListenerEndpoint endpoint) {
5555
return this.suffixer.maybeAddTo(endpoint.getClientIdPrefix());
5656
}
5757

5858
@Override
59-
public String getGroup(MethodKafkaListenerEndpoint<?, ?> endpoint) {
59+
public String getGroup(KafkaListenerEndpoint endpoint) {
6060
return this.suffixer.maybeAddTo(endpoint.getGroup());
6161
}
6262

0 commit comments

Comments
 (0)