Skip to content

Configured adapter for @HttpExchange proxy group is ignored (Boot 4) #47855

@ch4mpy

Description

@ch4mpy

I'm trying to integrate my existing RestClient and WebClient auto-configuration with what is added to Boot 4. 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));
        }
      });
    };
  }
}

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    for: external-projectFor an external project and not something we can fix

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions