Skip to content
Merged
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 2014-2022 the original author or authors.
* Copyright 2014-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 @@ -268,7 +268,7 @@ public void setApplicationContext(ApplicationContext applicationContext) throws
* {@link #setEndpointRegistry endpoint registry} has to be explicitly configured.
* @param beanFactory the {@link BeanFactory} to be used.
*/
public void setBeanFactory(BeanFactory beanFactory) {
public synchronized void setBeanFactory(BeanFactory beanFactory) {
this.beanFactory = beanFactory;
if (beanFactory instanceof ConfigurableListableBeanFactory clbf) {
this.resolver = clbf.getBeanExpressionResolver();
Expand Down Expand Up @@ -449,8 +449,8 @@ private KafkaListener enhance(AnnotatedElement element, KafkaListener ann) {
}
}

private void processMultiMethodListeners(Collection<KafkaListener> classLevelListeners, List<Method> multiMethods,
Object bean, String beanName) {
private synchronized void processMultiMethodListeners(Collection<KafkaListener> classLevelListeners,
List<Method> multiMethods, Object bean, String beanName) {

List<Method> checkedMethods = new ArrayList<>();
Method defaultMethod = null;
Expand All @@ -477,7 +477,9 @@ private void processMultiMethodListeners(Collection<KafkaListener> classLevelLis
}
}

protected void processKafkaListener(KafkaListener kafkaListener, Method method, Object bean, String beanName) {
protected synchronized void processKafkaListener(KafkaListener kafkaListener, Method method, Object bean,
String beanName) {

Method methodToUse = checkProxy(method, bean);
MethodKafkaListenerEndpoint<K, V> endpoint = new MethodKafkaListenerEndpoint<>();
endpoint.setMethod(methodToUse);
Expand Down