Skip to content

Commit

Permalink
fix: use qualifier name for formatting conversion service
Browse files Browse the repository at this point in the history
- 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
  • Loading branch information
pearsonradu authored and kptfh committed Sep 4, 2024
1 parent 016ef9d commit 5109774
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -65,7 +66,7 @@ public class ReactiveFeignClientsConfiguration {
@Bean
@ConditionalOnMissingBean
public Contract reactiveFeignContract(
List<AnnotatedParameterProcessor> parameterProcessors, FormattingConversionService feignConversionService) {
List<AnnotatedParameterProcessor> parameterProcessors, @Qualifier("feignConversionService") FormattingConversionService feignConversionService) {
return new SpringMvcContract(parameterProcessors, feignConversionService);
}

Expand Down

0 comments on commit 5109774

Please sign in to comment.