From 1278f4bff5b9bd464a112e18053bbd44d7a87402 Mon Sep 17 00:00:00 2001 From: Pearson Radu Date: Wed, 4 Sep 2024 10:55:12 -0400 Subject: [PATCH] fix: use qualifier name for formatting conversion service - Use `feignConversionService` qualifier name for `reactiveFeignContract` bean - If qualified name is not used it will conflict with Spring's predefined conversion service - `Caused by: org.springframework.beans.factory.NoUniqueBeanDefinitionException: No qualifying bean of type 'org.springframework.format.support.FormattingConversionService' available: expected single matching bean but found 2: feignConversionService,webFluxConversionService` - See https://github.com/spring-projects/spring-boot/blob/f88f8f26fde93df292e1b50a490768058c67b127/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/reactive/WebFluxAutoConfiguration.java#L283 --- .../spring/config/ReactiveFeignClientsConfiguration.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/feign-reactor-spring-configuration/src/main/java/reactivefeign/spring/config/ReactiveFeignClientsConfiguration.java b/feign-reactor-spring-configuration/src/main/java/reactivefeign/spring/config/ReactiveFeignClientsConfiguration.java index 6007f55a..7e9c64db 100644 --- a/feign-reactor-spring-configuration/src/main/java/reactivefeign/spring/config/ReactiveFeignClientsConfiguration.java +++ b/feign-reactor-spring-configuration/src/main/java/reactivefeign/spring/config/ReactiveFeignClientsConfiguration.java @@ -19,6 +19,7 @@ import feign.Contract; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.boot.autoconfigure.AutoConfigureAfter; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; @@ -65,7 +66,7 @@ public class ReactiveFeignClientsConfiguration { @Bean @ConditionalOnMissingBean public Contract reactiveFeignContract( - List parameterProcessors, FormattingConversionService feignConversionService) { + List parameterProcessors, @Qualifier("feignConversionService") FormattingConversionService feignConversionService) { return new SpringMvcContract(parameterProcessors, feignConversionService); }