Skip to content

FeignHttpMessageConverters#initConvertersIfRequired has a concurrency issues #1371

Closed

Description

@jasonjiang9527

Describe the bug
when first call a feign method concurrent after application startup ,exception Could not write request: no suitable HttpMessageConverter found for request type will be reported .

Sample

@FeignClient(name = "spring4-dep", path = "/api", url = "http://localhost:8080")
public interface Api {
    @PostMapping
    String test(@RequestBody Map map);
}


@SpringBootApplication
@EnableFeignClients
public class Spring4DepApplication {
    public static void main(String[] args) {
        ConfigurableApplicationContext run = SpringApplication.run(Spring4DepApplication.class, args);
        Api bean = run.getBean(Api.class);
        List<CompletableFuture<Void>> futureList = new ArrayList<>();
        for (int i = 0; i < 10; i++) {
            futureList.add(CompletableFuture.runAsync(() -> bean.test(Map.of("", ""))));
        }
        CompletableFuture.allOf(futureList.toArray(new CompletableFuture[0])).join();
    }
}

Activity

  1. added a commit that references this issue on Apr 30, 2026
  2. added
    bug
    and removed on Apr 30, 2026
  3. added a commit that references this issue on May 6, 2026
  4. added this to the 5.0.3 milestone on Jun 15, 2026
  5. added a commit that references this issue on Jun 28, 2026
    4ad38de
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions