You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dubbo.apache.org by yi...@apache.org on 2020/10/13 03:07:05 UTC

[dubbo] branch master updated: In order to facilitate the consumer to better locate the failure of provider token check, the token value called by consumer will be printed out in the exception information (#6800)

This is an automated email from the ASF dual-hosted git repository.

yizhenqiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/dubbo.git


The following commit(s) were added to refs/heads/master by this push:
     new f9f10ba  In order to facilitate the consumer to better locate the failure of provider token check, the token value called by consumer will be printed out in the exception information (#6800)
f9f10ba is described below

commit f9f10ba5225e80c34953f56123ac1702c13e45c7
Author: yizhenqiang <ma...@163.com>
AuthorDate: Tue Oct 13 11:06:55 2020 +0800

    In order to facilitate the consumer to better locate the failure of provider token check, the token value called by consumer will be printed out in the exception information (#6800)
---
 .../src/main/java/org/apache/dubbo/rpc/filter/TokenFilter.java        | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/dubbo-rpc/dubbo-rpc-api/src/main/java/org/apache/dubbo/rpc/filter/TokenFilter.java b/dubbo-rpc/dubbo-rpc-api/src/main/java/org/apache/dubbo/rpc/filter/TokenFilter.java
index 811a8e5..22e02a0 100644
--- a/dubbo-rpc/dubbo-rpc-api/src/main/java/org/apache/dubbo/rpc/filter/TokenFilter.java
+++ b/dubbo-rpc/dubbo-rpc-api/src/main/java/org/apache/dubbo/rpc/filter/TokenFilter.java
@@ -48,7 +48,9 @@ public class TokenFilter implements Filter {
             Map<String, Object> attachments = inv.getObjectAttachments();
             String remoteToken = (attachments == null ? null : (String) attachments.get(TOKEN_KEY));
             if (!token.equals(remoteToken)) {
-                throw new RpcException("Invalid token! Forbid invoke remote service " + serviceType + " method " + inv.getMethodName() + "() from consumer " + RpcContext.getContext().getRemoteHost() + " to provider " + RpcContext.getContext().getLocalHost());
+                throw new RpcException("Invalid token! Forbid invoke remote service " + serviceType + " method " + inv.getMethodName()
+                        + "() from consumer " + RpcContext.getContext().getRemoteHost() + " to provider " + RpcContext.getContext().getLocalHost()
+                        + ", consumer incorrect token is " + remoteToken);
             }
         }
         return invoker.invoke(inv);