Skip to content

Configured adapter for @HttpExchange proxy group is ignored (7.0.0-RC2) #35707

@ch4mpy

Description

@ch4mpy

Shouldn't the ProxyHttpServiceGroup::createProxies method set the proxyFactoryBuilder's exchangeAdapter only if it isn't set already?

As already reported in spring-projects/spring-boot#47855, I'm trying to integrate my existing RestClient and WebClient auto-configuration with what is added to Boot 4.0.0-RC1. However, whatever I configure with the following is ignored:

@Configuration
@ImportHttpServices(group = "bidule", types = {BiduleApi.class})
@ImportHttpServices(group = "machin", types = {MachinApi.class})
public class RestConfiguration {

  @Bean
  RestClientHttpServiceGroupConfigurer groupConfigurer(RestClient biduleClient,
      RestClient machinClient) {
    return groups -> {
      groups.forEachGroup((group, clientBuilder, factoryBuilder) -> {
        if ("bidule".equals(group.name())) {
          factoryBuilder.exchangeAdapter(RestClientAdapter.create(biduleClient));
        } else if ("machin".equals(group.name())) {
          factoryBuilder.exchangeAdapter(RestClientAdapter.create(machinClient));
        }
      });
    };
  }
}

Metadata

Metadata

Assignees

Labels

in: webIssues in web modules (web, webmvc, webflux, websocket)type: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions