You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by GitBox <gi...@apache.org> on 2020/12/19 08:04:47 UTC

[GitHub] [servicecomb-java-chassis] lengshanwudi opened a new issue #2151: 接口日志在URI尾部拼接特殊字符,该特殊字符产生传递拼接问题

lengshanwudi opened a new issue #2151:
URL: https://github.com/apache/servicecomb-java-chassis/issues/2151


   一个业务的请求流向为A-->B-->C
   
   1、A服务调用B服务GET:v1/skill 接口,A服务在调用该接口前,调用如下方法在接口URI尾部拼接“skillName”字段,用于标识某类业务请求 ContextUtils.getInvocationContext().addContext(Constant.Trace.CONTEXT_APPEND_URL, skillName);
   2、服务B处理完GET:v1/skill业务时,调用了C服务的GET:v1/user 接口。
   问题:B、C服务的接口日志中均打印了GET:v1/user/skillName 接口,而不是GET:v1/user。这里接口日志是否应该传递拼接?


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

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



[GitHub] [servicecomb-java-chassis] liubao68 edited a comment on issue #2151: 接口日志在URI尾部拼接特殊字符,该特殊字符产生传递拼接问题

Posted by GitBox <gi...@apache.org>.
liubao68 edited a comment on issue #2151:
URL: https://github.com/apache/servicecomb-java-chassis/issues/2151#issuecomment-770124707


   你说的功能似乎是业务自己定制的功能。 java-chassis并没有提供在URL末尾追加URL的功能。 如果方便,你也可以尝试使用java-chassis的samples验证下,并提供一个例子,供分析使用。 
   如果是业务自己定制的功能, 肯定有某段代码使用了getContext读取参数,改为getLocalContext即可。


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

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



[GitHub] [servicecomb-java-chassis] lengshanwudi commented on issue #2151: 接口日志在URI尾部拼接特殊字符,该特殊字符产生传递拼接问题

Posted by GitBox <gi...@apache.org>.
lengshanwudi commented on issue #2151:
URL: https://github.com/apache/servicecomb-java-chassis/issues/2151#issuecomment-749523512


   多谢:)


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

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



[GitHub] [servicecomb-java-chassis] lengshanwudi commented on issue #2151: 接口日志在URI尾部拼接特殊字符,该特殊字符产生传递拼接问题

Posted by GitBox <gi...@apache.org>.
lengshanwudi commented on issue #2151:
URL: https://github.com/apache/servicecomb-java-chassis/issues/2151#issuecomment-759320641


   ![image](https://user-images.githubusercontent.com/10349459/104430021-2c95dc80-55c1-11eb-94fe-8b4c5ca49cdf.png)
   使用addContext("appendUrl", skillName) ,原来在uri尾部可以在追加尾部skillName字符串,修改为addLocalContext("appendUrl", skillName) 无法追加,还有其他的参数需要修改吗?


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

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



[GitHub] [servicecomb-java-chassis] liubao68 closed issue #2151: 接口日志在URI尾部拼接特殊字符,该特殊字符产生传递拼接问题

Posted by GitBox <gi...@apache.org>.
liubao68 closed issue #2151:
URL: https://github.com/apache/servicecomb-java-chassis/issues/2151


   


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

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



[GitHub] [servicecomb-java-chassis] liubao68 commented on issue #2151: 接口日志在URI尾部拼接特殊字符,该特殊字符产生传递拼接问题

Posted by GitBox <gi...@apache.org>.
liubao68 commented on issue #2151:
URL: https://github.com/apache/servicecomb-java-chassis/issues/2151#issuecomment-770124707


   你说的功能似乎是业务自己定制的功能。 java-chassis并没有提供在URL末尾追加URL的功能。 如果方便,你也可以尝试使用java-chassis的samples验证下,并提供一个例子,供分析使用。 


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

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



[GitHub] [servicecomb-java-chassis] lengshanwudi closed issue #2151: 接口日志在URI尾部拼接特殊字符,该特殊字符产生传递拼接问题

Posted by GitBox <gi...@apache.org>.
lengshanwudi closed issue #2151:
URL: https://github.com/apache/servicecomb-java-chassis/issues/2151


   


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

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



[GitHub] [servicecomb-java-chassis] liubao68 commented on issue #2151: 接口日志在URI尾部拼接特殊字符,该特殊字符产生传递拼接问题

Posted by GitBox <gi...@apache.org>.
liubao68 commented on issue #2151:
URL: https://github.com/apache/servicecomb-java-chassis/issues/2151#issuecomment-748984144


   ContextUtils.getInvocationContext().addContext 的内容会在调用链中传递,A设置的, 那么B、C取到的是一样的值。 如果不期望传递,那么应该调用 addLocalContext


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

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