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 2021/09/08 16:22:27 UTC

[GitHub] [dubbo] plusmancn opened a new issue #8733: [3.0-Triple] Application service discovery had broken down because of consumerModel in TripleClientHandler

plusmancn opened a new issue #8733:
URL: https://github.com/apache/dubbo/issues/8733


   - [x] I have searched the [issues](https://github.com/apache/dubbo/issues) of this repository and believe that this is not a duplicate.
   - [x] 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.
   
   Because of TripleClientHandler working in a new thread, The line `url.getServiceMode`  doesn't work in TripleClientHandler with InstanceAddressURL when we try to use application-service-discovery.
   ```java
   // => org.apache.dubbo.rpc.protocol.tri.TripleClientHandler#writeRequest
   private void writeRequest(ChannelHandlerContext ctx, final Request req, final ChannelPromise promise) {
       final RpcInvocation inv = (RpcInvocation) req.getData();
       final URL url = inv.getInvoker().getUrl();
       // Here will throw NPE
       ConsumerModel consumerModel = (ConsumerModel) url.getServiceModel();
       // ......
   }
   ```
   
   See InstanceAddressURL:
   ```java
   // => org.apache.dubbo.registry.client.InstanceAddressURL#getServiceModel
   public ServiceModel getServiceModel() {
       return RpcContext.getServiceContext().getConsumerUrl().getServiceModel();
   }
   
   // => org.apache.dubbo.rpc.RpcContext
   private static final InternalThreadLocal<RpcServiceContext> SERVICE_CONTEXT = new InternalThreadLocal<RpcServiceContext>() {
       @Override
       protected RpcServiceContext initialValue() {
           return new RpcServiceContext();
       }
   };
   ```
   


-- 
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] guohao closed issue #8733: [3.0-Triple] Application service discovery had broken down because of consumerModel's NPE in TripleClientHandler

Posted by GitBox <gi...@apache.org>.
guohao closed issue #8733:
URL: https://github.com/apache/dubbo/issues/8733


   


-- 
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