EarthChen opened a new issue #8738: URL: https://github.com/apache/dubbo/issues/8738
- [ ] I have searched the [issues](https://github.com/apache/dubbo/issues) of this repository and believe that this is not a duplicate. - [ ] I have checked the [FAQ](https://github.com/apache/dubbo/blob/master/FAQ.md) of this repository and believe that this is not a duplicate. ### Environment * Dubbo version: 3.0.3-SNAPSHOT * Operating System version: macos * Java version: 1.8 ### Steps to reproduce this issue #### code 1. server ```java @Override public GreeterReply greetWithAttachment(GreeterRequest request) { final String key = "user-attachment"; final String value = RpcContext.getServerAttachment().getAttachment(key); RpcContext.getServerContext().setObjectAttachment(key, value); return GreeterReply.newBuilder().setMessage("hello," + request.getName()).build(); } ``` 2. client ```java @Test public void attachmentTest() { final String key = "user-attachment"; final String value = "attachment-value"; RpcContext.removeClientAttachment(); RpcContext.getClientAttachment().setAttachment(key, value); delegate.greetWithAttachment(GreeterRequest.newBuilder().setName("meta").build()); final String returned = (String) RpcContext.getServiceContext().getObjectAttachment(key); Assert.assertEquals(value, returned); } ``` #### steps 1. start provider 2. start consumer with Url directly connect 3. start consumer with zk registry Pls. provide [GitHub address] to reproduce this issue. https://github.com/apache/dubbo-samples/pull/356 ### Expected Result consumer test is ok ### Actual Result The consumer test using the URL direct connection succeeded. The consumer test using Zookeper failed. If there is an exception, please attach the exception trace: ``` Just put your stack trace here! ``` -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
