Skip to content

Commit

Permalink
Updated RabbitMqConfiguration
Browse files Browse the repository at this point in the history
- Narrowed exceptions caught to be more specific (Instead of catching Exception, catching IOException and TimeoutException).
- Set default value for handlers to be an empty array
  • Loading branch information
matthewhorridge committed Mar 20, 2024
1 parent 19361c9 commit 5c705ca
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public class RabbitMqConfiguration {


@Autowired(required = false)
private List<CommandHandler<? extends Request, ? extends Response>> handlers;
private List<CommandHandler<? extends Request, ? extends Response>> handlers = new ArrayList<>();


@Autowired
Expand Down Expand Up @@ -188,7 +188,7 @@ public void createBindings() {
}
channel.queueBind(getCommandResponseQueue(), COMMANDS_EXCHANGE, getCommandResponseQueue());

} catch (Exception e) {
} catch (IOException |TimeoutException e) {
logger.error("Error initialize bindings", e);
}
}
Expand Down

0 comments on commit 5c705ca

Please sign in to comment.