Add Converter Factories to Method Factory

Similar to `Converter`s, add any `ConverterFactory` beans to the
default `MessageHandlerMethodFactory`.

add converterFactory

add converterFactory

add converterFactory
This commit is contained in:
wruiiwang
2022-06-07 22:49:03 +08:00
committed by Gary Russell
parent 273416c880
commit 168b9d274f

View File

@@ -72,6 +72,7 @@ import org.springframework.core.annotation.AnnotationUtils;
import org.springframework.core.convert.TypeDescriptor;
import org.springframework.core.convert.converter.ConditionalGenericConverter;
import org.springframework.core.convert.converter.Converter;
import org.springframework.core.convert.converter.ConverterFactory;
import org.springframework.core.convert.converter.GenericConverter;
import org.springframework.core.log.LogAccessor;
import org.springframework.format.Formatter;
@@ -1021,6 +1022,9 @@ public class KafkaListenerAnnotationBeanPostProcessor<K, V>
for (Converter<?, ?> converter : getBeansOfType(Converter.class)) {
registry.addConverter(converter);
}
for (ConverterFactory<?, ?> converter : getBeansOfType(ConverterFactory.class)) {
registry.addConverterFactory(converter);
}
for (GenericConverter converter : getBeansOfType(GenericConverter.class)) {
registry.addConverter(converter);
}