The @HystrixCommand annotation has the ability to specify exceptions types that should be ignored:
@HystrixCommand(ignoreExceptions = {BadRequestException.class}) public Account findAccountById(String id) { return accountService.findAccountById(id); }
If accountService.findAccountById(id) throws an exception of the BadRequestException type, then this exception will be wrapped in HystrixBadRequestException and be-thrown without triggering the fallback logic.
Let's create a REST controller for the customer service.