-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
@RetryableTopic support KL annotated on class part 2 #3112
@RetryableTopic support KL annotated on class part 2 #3112
Conversation
* `EndpointCustomizerFactory` adaptor `MultiMethodKafkaListenerEndpoint`. * `RetryTopicConfigurer.processAndRegisterEndpoint` support `@KafkaListener` on a class. * Add new class `EndpointHandlerMultiMethod` to handler multi method for retrying endpoints. part2 of spring-projects#3105 and this contributes to fixing spring-projects#3105 eventually
public void setDefaultMethod(Method defaultMethod) { | ||
this.defaultMethod = defaultMethod; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding new public methods in a public class. This deserves a brief mention in whats-new
.
|
||
/** | ||
* Customize the endpoint and return the topic names generated for this endpoint. | ||
* @param listenerEndpoint The main, retry or DLT endpoint to be customized. | ||
* @return A collection containing the topic names generated for this endpoint. | ||
*/ | ||
Collection<TopicNamesHolder> customizeEndpointAndCollectTopics(MethodKafkaListenerEndpoint<?, ?> listenerEndpoint); | ||
Collection<TopicNamesHolder> customizeEndpointAndCollectTopics(T listenerEndpoint); | ||
|
||
class TopicNamesHolder { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Modifying the interface signature, which is part of the public API. Although we are just adding a strong type here and it may not affect any implementations, we may also need to mention this in whats-new.
- the fact that EndpointCustomizer
is strictly for MethodKafkaListenerEndpoint
types.
} | ||
|
||
protected EndpointCustomizer addSuffixesAndMethod(DestinationTopic.Properties properties, Object bean, Method method) { | ||
protected EndpointCustomizer<MethodKafkaListenerEndpoint<?, ?>> addSuffixesAndMethod( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Public API modified. It may theoretically break any external implementations (although very unlikely that some might be implementing this, we need to be mindful of that possibility. Why don't we deprecate the original and add the modification separately?
@@ -54,6 +54,12 @@ public EndpointHandlerMethod(Object beanOrClass, String methodName) { | |||
this.methodName = methodName; | |||
} | |||
|
|||
public EndpointHandlerMethod(Object bean) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
new public constructor that needs to be mentioned in docs (or whats-new
).
this.defaultMethod = defaultMethod; | ||
} | ||
|
||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New public API class that needs to be mentioned in whats-new
.
…ionTopic.Properties, Object, Method)`. * Change public API that mentioned in `whats-new.adoc`(or javadoc).
spring-kafka-docs/src/main/antora/modules/ROOT/pages/whats-new.adoc
Outdated
Show resolved
Hide resolved
Fixes: #3012 * Non-blocking retries support for `@KafkaListener` on class level, which includes `@RetryableTopic,` `@DltHandler,` `RetryTopicConfiguration,` and `RetryTopicConfigurationSupport.` * Doc and test for Non-blocking retries support for @KafkaListener on class level. * Addressing PR review. See these earlier related PRs: #3112 #3107
EndpointCustomizerFactory
adaptorMultiMethodKafkaListenerEndpoint
.RetryTopicConfigurer.processAndRegisterEndpoint
support@KafkaListener
on a class.EndpointHandlerMultiMethod
to handler multi method for retrying endpoints.part2 of #3105 and this contributes to fixing #3105 eventually.