You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "CrazyHZM (GitHub)" <gi...@apache.org> on 2019/01/07 03:28:01 UTC
[GitHub] [incubator-dubbo] CrazyHZM commented on issue #3043: wrong
event setting
> @CrazyHZM, would you mind to take a look at my comment? I think the root cause is
>
> ```java
> if ((flag & FLAG_EVENT) != 0) {
> res.setEvent(Response.HEARTBEAT_EVENT);
> }
> ```
>
> once we change it to
>
> ```java
> if ((flag & FLAG_EVENT) != 0) {
> res.setEvent(true);
> }
> ```
>
> then we should not need the following logic any longer:
>
> ```java
> if (!req.isBroken()) {
> if ((flag & FLAG_EVENT) != 0) {
> if (data != null && data.equals(Request.READONLY_EVENT)) {
> req.setEvent(Request.READONLY_EVENT);
> } else {
> req.setEvent(Request.HEARTBEAT_EVENT);
> }
> }
> req.setData(data);
> } else {
> if ((flag & FLAG_EVENT) != 0) {
> req.setEvent(true);
> }
> }
> ```
>
> And, in your change, you consider request only, pls. take care response too.
I agree with you. If you do this, you can guarantee the scalability of the event in the future. I will modify it.
[ Full content available at: https://github.com/apache/incubator-dubbo/pull/3043 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org