Skip to content

backward compatible with ListenableFilter#5623

Merged
chickenlj merged 1 commit intoapache:masterfrom
CodingSinger:filter_compatibility
Jan 10, 2020
Merged

backward compatible with ListenableFilter#5623
chickenlj merged 1 commit intoapache:masterfrom
CodingSinger:filter_compatibility

Conversation

@CodingSinger
Copy link
Copy Markdown
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
Copy Markdown
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