Skip to content

fix a default method defect in ConsumerFactory #2945

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
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 2018-2021 the original author or authors.
* Copyright 2018-2023 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 Down Expand Up @@ -27,7 +27,7 @@
import java.lang.annotation.Target;

/**
* Annotation to determine the method the should process the DLT topic message.
* Annotation to determine the method that should process the DLT topic message.
* The method can have the same parameters as a {@link KafkaListener} method can (Message, Acknowledgement, etc).
*
* The annotated method must be in the same class as the corresponding {@link KafkaListener} annotation.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2016-2021 the original author or authors.
* Copyright 2016-2023 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 Down Expand Up @@ -27,7 +27,7 @@
import org.springframework.lang.Nullable;

/**
* The strategy to produce a {@link Consumer} instance(s).
* The strategy to produce a {@link Consumer} instance.
*
* @param <K> the key type.
* @param <V> the value type.
Expand Down Expand Up @@ -79,8 +79,10 @@ default Consumer<K, V> createConsumer(@Nullable String groupId, @Nullable String
* @return the consumer.
* @since 2.1.1
*/
Consumer<K, V> createConsumer(@Nullable String groupId, @Nullable String clientIdPrefix,
@Nullable String clientIdSuffix);
default Consumer<K, V> createConsumer(@Nullable String groupId, @Nullable String clientIdPrefix,
@Nullable String clientIdSuffix) {
return createConsumer(groupId, clientIdPrefix, clientIdSuffix, null);
}

/**
* Create a consumer with an explicit group id; in addition, the
Expand All @@ -94,11 +96,8 @@ Consumer<K, V> createConsumer(@Nullable String groupId, @Nullable String clientI
* @return the consumer.
* @since 2.2.4
*/
default Consumer<K, V> createConsumer(@Nullable String groupId, @Nullable String clientIdPrefix,
@Nullable String clientIdSuffix, @Nullable Properties properties) {

return createConsumer(groupId, clientIdPrefix, clientIdSuffix);
}
Consumer<K, V> createConsumer(@Nullable String groupId, @Nullable String clientIdPrefix,
@Nullable String clientIdSuffix, @Nullable Properties properties);

/**
* Return true if consumers created by this factory use auto commit.
Expand Down Expand Up @@ -155,7 +154,6 @@ default boolean removeListener(Listener<K, V> listener) {
* @since 2.5.3
*/
default void addListener(int index, Listener<K, V> listener) {

}

/**
Expand All @@ -164,7 +162,6 @@ default void addListener(int index, Listener<K, V> listener) {
* @since 2.5.3
*/
default void addListener(Listener<K, V> listener) {

}

/**
Expand All @@ -182,7 +179,6 @@ default List<Listener<K, V>> getListeners() {
* @since 2.5.3
*/
default void addPostProcessor(ConsumerPostProcessor<K, V> postProcessor) {

}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -352,13 +352,6 @@ public void removeConfig(String configKey) {
this.configs.remove(configKey);
}

@Override
public Consumer<K, V> createConsumer(@Nullable String groupId, @Nullable String clientIdPrefix,
@Nullable String clientIdSuffix) {

return createKafkaConsumer(groupId, clientIdPrefix, clientIdSuffix, null);
}

@Override
public Consumer<K, V> createConsumer(@Nullable String groupId, @Nullable String clientIdPrefix,
@Nullable final String clientIdSuffixArg, @Nullable Properties properties) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,8 @@ private static class InternalConfiguration extends Configuration {
private final Configuration delegate;

InternalConfiguration(Map<String, AppConfigurationEntry[]> configurationEntries, Configuration delegate) {
Assert.notNull(configurationEntries, " cannot be null");
Assert.notEmpty(configurationEntries, " cannot be empty");
Assert.notNull(configurationEntries, "'configurationEntries' cannot be null");
Assert.notEmpty(configurationEntries, "'configurationEntries' cannot be empty");
this.configurationEntries = configurationEntries;
this.delegate = delegate;
}
Expand Down