0

I have a @Bulkhead method like this

@GetMapping("/bulkhead")
@Bulkhead(name = USER_SERVICE, fallbackMethod = "bulkheadDefault")
public ResponseEntity<String> testBulkhead(){
    logger.info("call " + Thread.currentThread().getName());
    String response = restTemplate.getForObject(BASEURL_BULKHEAD, String.class);
    logger.info(LocalTime.now() + " Call processing finished = " + Thread.currentThread().getName());
    return ResponseEntity.ok(response);
}

When I call this method from another class by creating 10 threads it works fine

for (int i=0; i<10; i++)
        new Thread(()-> userServiceApplication.testBulkhead()).start();

But when I call it like above in the same class all threads call bulkhead method sequentially. Anyone can explain why this is happening?

myfidan
  • 11
  • 3

0 Answers0