Skip to content

Use KafkaListenerEndpoint instead of MethodKafkaListenerEndpoint in the RetryTopicNamesProvider #2312

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

Merged
merged 1 commit into from
Jun 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2021 the original author or authors.
* Copyright 2021-2022 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.
Expand All @@ -16,7 +16,7 @@

package org.springframework.kafka.retrytopic;

import org.springframework.kafka.config.MethodKafkaListenerEndpoint;
import org.springframework.kafka.config.KafkaListenerEndpoint;

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

/**
* Return the groupId that will override the endpoint's groupId.
*
* @param endpoint the endpoint to override
* @return The groupId
*/
String getGroupId(MethodKafkaListenerEndpoint<?, ?> endpoint);
String getGroupId(KafkaListenerEndpoint endpoint);

/**
* Return the clientId prefix that will override the endpoint's clientId prefix.
*
* @param endpoint the endpoint to override
* @return The clientId prefix
*/
String getClientIdPrefix(MethodKafkaListenerEndpoint<?, ?> endpoint);
String getClientIdPrefix(KafkaListenerEndpoint endpoint);

/**
* Return the group that will override the endpoint's group.
*
* @param endpoint the endpoint to override
* @return The clientId prefix
*/
String getGroup(MethodKafkaListenerEndpoint<?, ?> endpoint);
String getGroup(KafkaListenerEndpoint endpoint);

/**
* Return the tropic name that will override the base topic name.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2021 the original author or authors.
* Copyright 2021-2022 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.
Expand All @@ -16,7 +16,7 @@

package org.springframework.kafka.retrytopic;

import org.springframework.kafka.config.MethodKafkaListenerEndpoint;
import org.springframework.kafka.config.KafkaListenerEndpoint;
import org.springframework.kafka.support.Suffixer;

/**
Expand All @@ -41,22 +41,22 @@ public SuffixingRetryTopicNamesProvider(DestinationTopic.Properties properties)
}

@Override
public String getEndpointId(MethodKafkaListenerEndpoint<?, ?> endpoint) {
public String getEndpointId(KafkaListenerEndpoint endpoint) {
return this.suffixer.maybeAddTo(endpoint.getId());
}

@Override
public String getGroupId(MethodKafkaListenerEndpoint<?, ?> endpoint) {
public String getGroupId(KafkaListenerEndpoint endpoint) {
return this.suffixer.maybeAddTo(endpoint.getGroupId());
}

@Override
public String getClientIdPrefix(MethodKafkaListenerEndpoint<?, ?> endpoint) {
public String getClientIdPrefix(KafkaListenerEndpoint endpoint) {
return this.suffixer.maybeAddTo(endpoint.getClientIdPrefix());
}

@Override
public String getGroup(MethodKafkaListenerEndpoint<?, ?> endpoint) {
public String getGroup(KafkaListenerEndpoint endpoint) {
return this.suffixer.maybeAddTo(endpoint.getGroup());
}

Expand Down