You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by GitBox <gi...@apache.org> on 2022/12/27 08:29:51 UTC

[GitHub] [dubbo] YuWan1117 opened a new issue, #11208: 【dubbo-3.1.2】About “Experimental support for upper header in triple”

YuWan1117 opened a new issue, #11208:
URL: https://github.com/apache/dubbo/issues/11208

   <!-- If you need to report a security issue please visit https://github.com/apache/dubbo/security/policy -->
   
   - [ ] I have searched the [issues](https://github.com/apache/dubbo/issues) of this repository and believe that this is not a duplicate.
   
   ### Environment
   
   * Dubbo version: 3.1.4 
   * Java version: 1.8
   
   **我这里使用的是3.1.4版本,但是反馈的问题根据[Issue10761](https://github.com/apache/dubbo/pull/10761)描述已经在3.1.2版本修复**
   
   ### Steps to reproduce this issue
   
   [复现此问题的demo](https://github.com/YuWan1117/dubbo-demo/tree/ft-upperAttachment)
   
   1. 切到`github`的`dubbo-demo`项目的`ft-upperAttachment`分支
   2. 启动`hello-service`(provider)
   3. 启动`hello-admin` (consumer)
   4. 请求`http://127.0.0.1:9321/`观察服务日志
   #### Question Description
   发起请求时,`hello-admin`通过`consumerFilter`向`attachment`中写入`header`信息`TestKey`对应的值为`TestValue`,观察`hello-service`日志通过`attachment`获取`TestKey`为`null`,获取`testkey`为`TestValue`。
   
   ### Code Reference
   > consumerFilter
   ```
   @Slf4j
   @Activate(group = CommonConstants.CONSUMER)
   public class ConsumerFilter implements Filter {
   
       @Override
       public Result invoke(Invoker<?> invoker, Invocation invocation) throws RpcException {
           RpcContext.getClientAttachment().setAttachment("TestKey", "TestValue");
           log.info("ConsumerFilter, TestKey=TestValue");
           return invoker.invoke(invocation);
       }
   }
   ```
   > hello-service log
   ```
   log.info("call sayHello function, TestKey={} testkey={}",
                   RpcContext.getServerAttachment().getAttachment("TestKey"),  
                   RpcContext.getServerAttachment().getAttachment("testkey")); 
   ```
   
   ### Expected Behavior
   
   <!-- What do you expect from the above steps?-->
   期望`RpcContext.getServerAttachment().getAttachment("TestKey")`输出`TestValue`
   
   ### Actual Behavior
   
   <!-- What actually happens? -->
   实际`RpcContext.getServerAttachment().getAttachment("TestKey")`输出`null`,通过`RpcContext.getServerAttachment().getAttachment("testkey")`输出`TestValue`
   
   ### 最后
   辛苦社区同学解答我的疑问,是3.1.2版本没有成功修复还是我这里的理解/使用方式存在问题。感谢
   
   ### Reference
   [dubbo-3.1.2 release](https://github.com/apache/dubbo/releases/tag/dubbo-3.1.2)
   [Issue 10761 ](https://github.com/apache/dubbo/pull/10761)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] AlbumenJ commented on issue #11208: 【dubbo-3.1.2】About “Experimental support for upper header in triple”

Posted by GitBox <gi...@apache.org>.
AlbumenJ commented on issue #11208:
URL: https://github.com/apache/dubbo/issues/11208#issuecomment-1365848833

   @EarthChen PTAL


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] YuWan1117 commented on issue #11208: 【dubbo-3.1.2】About “Experimental support for upper header in triple”

Posted by GitBox <gi...@apache.org>.
YuWan1117 commented on issue #11208:
URL: https://github.com/apache/dubbo/issues/11208#issuecomment-1365802365

   补充:
   demo使用的是3.1.4版本,确认此版本含如下commit,即设置默认支持upper。
   另外去确认了下3.1.2版本,不包含此commit,即3.1.2版本默认不支持upper。
   [设置默认支持upper的commit](https://github.com/apache/dubbo/commit/dce55071c7989b23a5b81105e9103bc1a82115e1)
   
   **由于demo使用的是3.1.4版本,因此理论上应该是默认支持upper。**
   辛苦社区同学方便的时候看看此问题
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] YuWan1117 commented on issue #11208: 【dubbo-3.1.2】About “Experimental support for upper header in triple”

Posted by GitBox <gi...@apache.org>.
YuWan1117 commented on issue #11208:
URL: https://github.com/apache/dubbo/issues/11208#issuecomment-1366305927

   > > 补充: demo使用的是3.1.4版本,确认此版本含如下commit,即设置默认支持upper。 另外去确认了下3.1.2版本,不包含此commit,即3.1.2版本默认不支持upper。 [设置默认支持upper的commit](https://github.com/apache/dubbo/commit/dce55071c7989b23a5b81105e9103bc1a82115e1)
   > > **由于demo使用的是3.1.4版本,因此理论上应该是默认支持upper。** 辛苦社区同学方便的时候看看此问题
   > 
   > 最开始考虑不应该去默认支持,可以通过环境变量开启
   
   @EarthChen  这一点我明白,但是目前使用3.1.4测试此功能并没有生效。
   辛苦你这边看看最上面我的问题描述以及提供的demo,看看是不是一个bug或者我的理解或者使用方式有问题?
   感谢~


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] EarthChen closed issue #11208: 【dubbo-3.1.2】About “Experimental support for upper header in triple”

Posted by GitBox <gi...@apache.org>.
EarthChen closed issue #11208: 【dubbo-3.1.2】About “Experimental support for upper header in triple”
URL: https://github.com/apache/dubbo/issues/11208


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] EarthChen commented on issue #11208: 【dubbo-3.1.2】About “Experimental support for upper header in triple”

Posted by GitBox <gi...@apache.org>.
EarthChen commented on issue #11208:
URL: https://github.com/apache/dubbo/issues/11208#issuecomment-1365856027

   > 补充: demo使用的是3.1.4版本,确认此版本含如下commit,即设置默认支持upper。 另外去确认了下3.1.2版本,不包含此commit,即3.1.2版本默认不支持upper。 [设置默认支持upper的commit](https://github.com/apache/dubbo/commit/dce55071c7989b23a5b81105e9103bc1a82115e1)
   > 
   > **由于demo使用的是3.1.4版本,因此理论上应该是默认支持upper。** 辛苦社区同学方便的时候看看此问题
   
   最开始考虑不应该去默认支持,可以通过环境变量开启


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] YuWan1117 commented on issue #11208: 【dubbo-3.1.2】About “Experimental support for upper header in triple”

Posted by GitBox <gi...@apache.org>.
YuWan1117 commented on issue #11208:
URL: https://github.com/apache/dubbo/issues/11208#issuecomment-1366445042

   Hi @EarthChen
   我这边基于3.1.4-release分支代码进行了两处fix之后,测试结果满足预期。
   辛苦社区同学确认我的问题以及我的修复逻辑是否正确。
   感谢🙏
   
   `hello-admin`模块发起请求时携带`TestKey=TestValue`信息:
   ```
   2022-12-28 15:53:53 INFO [org.example.hello.filter.ConsumerFilter] ConsumerFilter, TestKey=TestValue
   ```
   `hello-service`模块响应请求时获取`TestKey`为预期的`TestValue`,获取`testkey`为`null`。
   ```
   2022-12-28 15:53:53 INFO [org.example.hello.service.DemoServiceImpl] call sayHello function, TestKey=TestValue testkey=null
   ```
   **Note:[demo演示](https://github.com/YuWan1117/dubbo-demo/tree/ft-upperAttachment)**
   
   ### 修改点1
   [见此`commit`的`comment`](https://github.com/apache/dubbo/commit/5fdc88d09e2fb7a6e795822ac9f9ebc4b8669c23)
   
   
   ### 修改点2
   ![`StreamUtils`类的`toAttachments`方法增加`converAttachment`逻辑处理](https://user-images.githubusercontent.com/7919137/209777541-0e0f1054-2fbe-4e5b-a988-670994db7bd0.png)
   
   再次感谢~


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org