-
Notifications
You must be signed in to change notification settings - Fork 138
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
Expose ErrDeliveryNotInitialized
variable
#191
base: main
Are you sure you want to change the base?
Expose ErrDeliveryNotInitialized
variable
#191
Conversation
What's the use case for this? In other words, what would your application do differently if the error matches |
I want to restart my consumer when this specific error happens |
Don't you want to restart your consumer when any error happens anyway? In other words, what makes this error different from the app point of view? Edit: I'm hesitant to modify the public API, unless there's a compelling use case for it. |
|
@quantumsheep have you actually seen If we're going to change one error, we may want to consider the other private ones:
|
IIRC, RabbitMQ will close the channel if there's any error returned from the server. In this case, the error is coming from the library, and as you are correctly pointing out, you have to restart your consumer (i.e. close-open a new channel). In either case, the channel gets closed. A potential improvement for your app would be to close the channel and open a new one. I agree there's no need to close the connection if there's an error in the To be honest, I'll be surprised if |
I don't think so, the only error I got when using If I sums up, I would need to restart my consumer whenever an error occurs, whatever the error is? |
Interesting 🤔 I'm happy to expose this error if we understand why it happens, and document it. We have to add a go-doc comment on the error, describing what it means.
From this library point of view, closing the channel is sufficient to "cancel" a pending message ack. If your consumer app can perform this operation, there is no need to restart the entire consumer app. |
Hi guys! I have the same problem and want to have errDeliveryNotInitialized exposed too. What stops us from merging this PR? I have this issue with Ack. Don't have steps to reproduce, but in my case, I have this during debugging. When receiving a message from a rabbit and going step by step in debug. After that sometimes see thousands messages in log with error |
758f7aa
to
b3c445f
Compare
Reviewing and testing this PR is on my to-do list, but I have other work to finish first. @smallhive also, please read the comments here. We can't just merge this PR without considering the implications to the public API. We'd like to know why this error is necessary versus what is already raised. |
I've read the comments, and from my point of view, the error required for clean understanding is the next: the error means the channel is closed, any other Acking leads to the same result, you must reconnect to the rabbit. I am trying to reproduce or find a way to reproduce the error. One I can say right now, it happens during debugging when you go through your code step-by-step. I am keeping my investigation |
Useful for checking the type of error