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 2021/06/24 02:02:22 UTC

[GitHub] [servicecomb-java-chassis] IcyZhang opened a new issue #2430: CSE从2.0.2升级到2.1.5,产品基于CSE的EventBus机制显示的接口日志打印问题。

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


   产品实现了一个RegisterEvent,去注册到CSE的EventManager中
   ![image](https://user-images.githubusercontent.com/21097832/123190863-e8452b80-d4d2-11eb-8c5f-a63cfc326fad.png)
   
   此类订阅 consume,来接受事件,进行打印接口日志(微服务a访问微服务b,微服务b处理完响应后,基于本机制打印接口日志)
   
   ![image](https://user-images.githubusercontent.com/21097832/123191024-28a4a980-d4d3-11eb-9c41-17aa3cc13e37.png)
   
   但是当前CSE从2.0.2升级到2.1.5后,不调用打印,想知道我们需要怎么适配
   


-- 
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] IcyZhang commented on issue #2430: CSE从2.0.2升级到2.1.5,产品基于CSE的EventBus机制显示的接口日志打印问题。

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


   断点找到原因了。
   response.getHeaders()  之前cse的版本,返回的是一个对象,然后我们再调用getFirst方法,这些都是有非空保证的。
   但是升级2.1.5后,response.getHeaders() 返回的是MultiMap headers,这个存在null的情况。我们再去get()就空指针了
   ![image](https://user-images.githubusercontent.com/21097832/123219245-44be4000-d4ff-11eb-9ab4-8e72c1487475.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.

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



[GitHub] [servicecomb-java-chassis] wujimin commented on issue #2430: CSE从2.0.2升级到2.1.5,产品基于CSE的EventBus机制显示的接口日志打印问题。

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


   * 本问题不相关
     * 建议
       * event不可能为null
       * invocation不可能为null
       * invocation.getInvocationStageTrace不可能为null
       * response不可能为null
       * 注册事件监听,可以让RegisterEvent实现BootListener接口,override onBeforeHandler方法,再`event.getScbEngine().getEventBus().register(this);`即可
         避免产生一个RegisterEvent的bean实例,又额外new了一个实例,new出来的实例还没办法使用spring注入
     * 问题
       * 方法还需要标记上`@AllowConcurrentEvents`,否则consume方法是不能并发的,会形成性能瓶颈
   * 本问题相关
     eventBus机制没有变化  
     有没有可能是打印代码有异常,建议在方法入口打个断点看看是什么情况


-- 
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 #2430: CSE从2.0.2升级到2.1.5,产品基于CSE的EventBus机制显示的接口日志打印问题。

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


   谢谢反馈。 这个确实是有修改, 也是三方件升级做的变化。 三方件根据HTTP协议的要求刷新了header规范(case insensitive)。 


-- 
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] IcyZhang commented on issue #2430: CSE从2.0.2升级到2.1.5,产品基于CSE的EventBus机制显示的接口日志打印问题。

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


   感谢两位的指导


-- 
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 #2430: CSE从2.0.2升级到2.1.5,产品基于CSE的EventBus机制显示的接口日志打印问题。

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


   这个代码看起来是没问题的。 可能需要调试下看看注册的监听器为什么没有被回调。 
   
   发送 InvovcationFinisheEvent 的代码在 Invocation onFinish 方法里面。 


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