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

Consumer onconnect, ondisconnect is not working #4580

Closed
2 tasks done
codeimport opened this issue Jul 16, 2019 · 5 comments
Closed
2 tasks done

Consumer onconnect, ondisconnect is not working #4580

codeimport opened this issue Jul 16, 2019 · 5 comments
Assignees
Milestone

Comments

@codeimport
Copy link
Contributor

codeimport commented Jul 16, 2019

  • I have searched the issues of this repository and believe that this is not a duplicate.
  • I have checked the FAQ of this repository and believe that this is not a duplicate.

Environment

  • Dubbo version: 2.7.3
  • Operating System version: windows10
  • Java version: JDK1.8

Steps to reproduce this issue

  1. set onconnect,ondisconnect parameter on @reference
  2. write onconnect,ondisconnect callback on consumer

code:

@Reference(onconnect = "onconnect")
private HelloDubboService helloDubboService;

public void onconnect(){
    System.out.println(">>>>>>>>>>>>>>>>>onconnect()");
}

Expected Result

it should invoke onconnect ,ondisconnect callback when the consumer connect the provider

Actual Result

it does not work

is it a bug?or these callback only be used on provider side?

@chickenlj
Copy link
Contributor

is it a bug?or these callback only be used on provider side?

At present, it only works on the provider side. But it would be a good complement if we can add support on the Consumer side.

@beiwei30
Copy link
Member

beiwei30 commented Aug 1, 2019

I will verify. I believe it starts working now after #4598 is merged.

@beiwei30
Copy link
Member

beiwei30 commented Aug 1, 2019

confirmed, it doesn't work. We need something like org.apache.dubbo.config.spring.schema.DubboBeanDefinitionParser#parseMethods when process @Method

@beiwei30 beiwei30 modified the milestones: some day, 2.7.5 Aug 1, 2019
@tswstarplanet
Copy link
Contributor

is it a bug?or these callback only be used on provider side?

At present, it only works on the provider side. But it would be a good complement if we can add support on the Consumer side.

In fact the consumer side can also trigger the connected and disconnected methods of ChannelHandler interface of dubbo.

@chickenlj chickenlj modified the milestones: 2.7.5, 2.7.6 Dec 30, 2019
@cvictory
Copy link
Contributor

cvictory commented Feb 5, 2020

从实现角度来看,provider和consumer的连接断开都应该可以增加一定的事件。
但是现在onconnect的配置是和接口绑定在一起,在后续的链路中会去找这个接口的对应实现。 consumer端是没有实现的,所以功能上暂时不能支持。

如果要在consumer端支持,应该需要调用一个独立的类和方法来完成, 如static方法。 暂时不建议增加。


From an implementation perspective, the disconnection between the provider and the consumer should be able to increase certain events.
But now the configuration of onconnect is bound to the interface, and the corresponding implementation of this interface will be found in subsequent links. The consumer side is not implemented, so it cannot be supported temporarily.

If you want to support it on the consumer side, you should call a separate class and method to complete it. It is not recommended to increase for the time being.

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

No branches or pull requests

5 participants