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

backward compatible with ListenableFilter #5623

Merged
merged 1 commit into from
Jan 10, 2020

Conversation

CodingSinger
Copy link
Member

@CodingSinger CodingSinger commented Jan 9, 2020

fix #5619
This pr is to fix the bug that is not compatible with the previous listenable filter in version 2.7.5, but if this pr is used, it will not be compatible with the filter created by the listener declared in 2.7.5. I think this should be regarded as an urgent bug-fix.
@chickenlj What do you think? Is there any other way to solve this problem perfectly?

@chickenlj chickenlj merged commit 63809bf into apache:master Jan 10, 2020

void onError(Throwable t, Invoker<?> invoker, Invocation invocation);
}
interface Listener2 {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think keep two methods in Listener is better:

interface Listener {
        @Deprecated
        void onResponse(Result appResponse, Invoker<?> invoker, Invocation invocation);

        default void onMessage(Result appResponse, Invoker<?> invoker, Invocation invocation) {
                onResponse(appResponse, invoker, invocation);
        }

        void onError(Throwable t, Invoker<?> invoker, Invocation invocation);
    }

Then call the onMessage method in ProtocolFilterWrapper, so user can implement eithor onMessage or onResponse method.

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 this pull request may close these issues.

Fix the bug can't backward compatible with ListenableFilter
3 participants