Skip to content
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

Stopping of Raw endpoint when using RabbitMQ on broken connection not work correctly #11

Closed
szymo0 opened this issue Mar 31, 2020 · 2 comments · Fixed by #12
Closed
Milestone

Comments

@szymo0
Copy link

szymo0 commented Mar 31, 2020

Hi,

I have problem when using NServiceBus.Router with RabbitMq Transport as one interface. In my production environment we had some issues with network connection, so one of our acceptance test i stop rabbiMq container and start it after some random time. When we done that we get very strange situation that some message was get from queue but never acked or processed. To avoid this problem we create mechanism of stopping router when rabbitMq is not available and start it/create when rabbit will be available again. But we get situation that all message except some that hangs. Also there was additional connection on rabbitMq from app. After some digging I found that problem is when stopping receiver in NServiceBus.Raw. There is only stopping on MessagePump but for RabbitMq it's work only when connection is in not closed state, when we have broken connection message pump is stopped, so message handling is detached from consumer but object is not disposing, reconnect task is still working and when connection is reestablished consumer download message but never processed it. Another drawback is that additional connection is shown i rabbitMq. I fixed it bu adding disposing IDisposable object when stopping receiver (I didn't any reference or reuse of object so it should be safe). That makes rabbitMq message pump disposing and disposing connection, circiuteBreaker mechanism. I not sure what situation is with sending component. I will create pull request with my fix, and If this solution is wrong please discard it.

szymo0 pushed a commit to szymo0/NServiceBus.Raw that referenced this issue Mar 31, 2020
@SzymonPobiega SzymonPobiega added this to the 3.1.1 milestone Mar 31, 2020
@SzymonPobiega
Copy link
Owner

@szymo0 Thanks for fixing this one. I've just released it as 3.1.1

@szymo0
Copy link
Author

szymo0 commented Mar 31, 2020

@SzymonPobiega No problem:)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants