New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Circuit breaker and kill switch not working #2229
Comments
Without code, or an example, I'll close this issue. And you shouldn't use both Circuit Breaker and Kill Switch together, Circuit Breaker doesn't make sense with message consumers. |
I didn't use them both at one time I tried them separately and I'll send you an example tomorrow |
Okay. It's been tested and works with every transport, you can see the configuration in the unit tests. So if it isn't working, verify that you've configured it correctly. |
RabbitMQTest |
If the consumer in ApiTwo is throwing exceptions, the Kill Switch will stop the endpoint and wait one minute before restarting it. If you make any requests using the request client during the time the receive endpoint is stopped, they would of course timeout as there isn't a consumer available to respond (that endpoint is stopped). So, it's working as intended. |
So what should I do if I want to get an exception immediately when consumer is unavailable? |
Immediately? That's a bit of an extreme demand, considering distributed systems. If you want an immediate failure when a remote endpoint is unavailable, stick to HTTP or gRPC that require an immediate connection. The request client doesn't know if an endpoint is consuming messages or not, it sends a message and waits for a response. If the timeout is reached, the request client throws a RequestTimeoutException. So your adjustment is that timeout, but setting it too short is sort of pointless, and you might as well use HTTPClient to call an API endpoint. It goes back to the age old question of when do you use messaging for RPC, versus a non-durable transport like HTTP when there are no side effects produced by the message being consumed. |
That's exactly what a circuit breaker must do |
You'd need the circuit breaker on the client side, before the request client. A circuit breaker on the consumer side would be worthless. |
yes I should do use it on client side |
maybe you want to keep it open for other users too see |
Is this a bug report?
Yes
Can you also reproduce the problem with the latest version?
Yes
Environment
Steps to Reproduce
(Write your steps here:)
Expected Behavior
After the circuit breaker opened the request shouldn't be processes by consumer and throw an exception immediately
Actual Behavior
Request is not processing by consumer but it doesn't throw an exception immediately instead it just wait for a long time before throwing exception
The text was updated successfully, but these errors were encountered: