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

Need some event to handle recovery success #156

Closed
miracles-happen opened this issue Feb 25, 2016 · 10 comments
Closed

Need some event to handle recovery success #156

miracles-happen opened this issue Feb 25, 2016 · 10 comments
Milestone

Comments

@miracles-happen
Copy link

Dear team,

is there any way (may be some event) to recognize connection recovery for RabbitMQ?

I have a dashboard in my application, and I want to display to user the status of listening from Rabbit MQ. I've set up AutomaticRecoveryEnabled = true for ConnectionFactory. And I've set up NetworkRecoveryInterval to 10 seconds.

And I handle EventingBasicConsumer 's Shutdown event in order to provide information about disconnection. (I also have ConnectionShutdown event of IConnection).
But I can't find any ability to handle recovery success. Is there any event in case the connection was recovered? I want to notify my users that connection was recovered.

Thank you.

@michaelklishin
Copy link
Member

There is no such event.

We have a nearly identical request for the Java client: rabbitmq/rabbitmq-java-client#132, so this is reasonable.

@michaelklishin michaelklishin added this to the 3.6.x milestone Feb 25, 2016
@resnikb
Copy link

resnikb commented Mar 4, 2016

Perhaps I'm misunderstanding the question, but isn't IRecoverable.Recovery event what you're looking for? You could subscribe to it by casting your connection to IRecoverable:

((IRecoverable)connection).Recovery += (sender, args) => {};

@michaelklishin
Copy link
Member

@resnikb the idea here is to have a recovery success/completion event(s).

@resnikb
Copy link

resnikb commented Mar 4, 2016

@michaelklishin Right... Isn't that what AutorecoverableConnection.Recovery is - an event that is raised when the connection has been successfully recovered?

@kbandrew
Copy link

kbandrew commented Jun 2, 2016

I have a similar requirement, as we need to send a custom logon message for the RabbitMQ broker that we connect to. We would like a recovey or reconnect event, so that we can resend the logon if required.

Would this ((IRecoverable)connection).Recovery += (sender, args) => {}; do the job?

@LoungeFlyZ
Copy link

Any progress with this issue? It would be really like to have a couple of events around recovery:

  • Success
  • Failure

Right now we are having issues with connection recovery and handling that correctly. Is there a way to detect connection recovery retry failure? In our case it's possible the username/pwd has changed and we would like to detect failure, get the new creds and then reconnect.

@michaelklishin
Copy link
Member

See authentication failure notifications.

On 11 Oct 2016, at 23:28, Chris Johnson [email protected] wrote:

Any progress with this issue? It would be really like to have a couple of events around recovery:

Success
Failure
Right now we are having issues with connection recovery and handling that correctly. Is there a way to detect connection recovery retry failure? In our case it's possible the username/pwd has changed and we would like to detect failure, get the new creds and then reconnect.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.

@LoungeFlyZ
Copy link

Thx @michaelklishin do you have a pointer to some docs i could read on that? I don't see anything in the dotnet guide. I see the exceptions/events in the dotnet library, just not obvious how i catch them.

@michaelklishin
Copy link
Member

Actually, no, authentication failure notifications are exposed as
exceptions in this client (and most others),
so recovery driver will handle it.

There is no progress on this. Feel free to take a look into introducing the
events you need, it should be fairly straightforward.
One concern I have is that "recovery failure" will mean different things to
different people: a single connection failure vs. N failures.

On Wed, Oct 12, 2016 at 12:28 AM, Chris Johnson [email protected]
wrote:

Thx @michaelklishin https://github.com/michaelklishin do you have a
pointer to some docs i could read on that? I don't see anything in the
dotnet guide. I see the exceptions/events in the dotnet library, just not
obvious how i catch them.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#156 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAAEQi3I7scBKcadBaGdGE1rZ87UnSwLks5qy_-GgaJpZM4Hiqqp
.

MK

Staff Software Engineer, Pivotal/RabbitMQ

@LoungeFlyZ
Copy link

Thx @michaelklishin i'll look into it. At the very least it would be nice to be notified of what's going on for logging purposes and so on vs. participating in the recovery. e.g. auth failures right during recovery keep happening indefinitely right now. With an event you could tear down the whole connection and start again if desired.

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

No branches or pull requests

5 participants