Skip to content

How to subscribe to onFailure events when using the circuit breaker strategy in the ResilienceCommand class #328

Closed Answered by SocketSomeone
fhosen asked this question in Q&A
Discussion options

You must be logged in to vote

@fhosen Hi there!

Thank you for question! With your question I found some issues with events and fixed them. (https://github.com/SocketSomeone/nestjs-resilience/releases/tag/2.1.1)
Now it`s works better:

  1. Failure and ShortCircuit events will be fired
  2. EventBus using singleton and you can access to them with ResilienceEventBus.getInstance() (https://github.com/SocketSomeone/nestjs-resilience/blob/master/test/commands/resilience.command.spec.ts#L53)

Btw, if you wanna create metrics storage by commands, feel free to open PR!

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by SocketSomeone
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants