rabbitmq-java-client icon indicating copy to clipboard operation
rabbitmq-java-client copied to clipboard

There is no RecoveryCallback counterpart for RecoveryListener

Open pbillen opened this issue 6 years ago • 4 comments

This is based on 5.5.0.

When implementing a recovery listener, I noticed that there is no RecoveryCallback counterpart for a RecoveryListener, to support lambda style of registering a callback. For most listeners (ShutdownListener, ConfirmListener, ...) we have such counterpart.

Is this something we want to add?

I'm happy to create a PR for this.

pbillen avatar Nov 19 '18 18:11 pbillen

If it's a matter of adding a "lambda-version" then I'd say please submit a PR :)

michaelklishin avatar Nov 19 '18 22:11 michaelklishin

Sure, why not. This is likely to be a breaking change though, so it will go in 6.x, not in 5.x.

acogoluegnes avatar Nov 20 '18 08:11 acogoluegnes

OK, will do in the next days. Do you agree that the callback for denoting the start of recovery (https://github.com/rabbitmq/rabbitmq-java-client/blob/master/src/main/java/com/rabbitmq/client/RecoveryListener.java#L38) is the first argument, and the the callback for denoting the completion of recovery (https://github.com/rabbitmq/rabbitmq-java-client/blob/master/src/main/java/com/rabbitmq/client/RecoveryListener.java#L30) is the second argument of the new addRecoveryListener(cb 1, cb 2) method?

pbillen avatar Nov 20 '18 12:11 pbillen

This looks reasonable to me. WDYT @michaelklishin?

acogoluegnes avatar Nov 20 '18 16:11 acogoluegnes