You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@rocketmq.apache.org by GitBox <gi...@apache.org> on 2021/02/03 02:54:08 UTC

[GitHub] [rocketmq-spring] wbzj1110 opened a new issue #346: DefaultRocketMQListenerContainer 仅对MessageExt做了处理没有对Message做额外处理不太妥当

wbzj1110 opened a new issue #346:
URL: https://github.com/apache/rocketmq-spring/issues/346


   https://github.com/apache/rocketmq-spring/blob/master/rocketmq-spring-boot/src/main/java/org/apache/rocketmq/spring/support/DefaultRocketMQListenerContainer.java#L459
   
   ![image](https://user-images.githubusercontent.com/11921135/106691106-e35c0a00-660d-11eb-86b2-613a1861b7b2.png)
   
   **大家使用@RocketmqListiner标签常用的对象是 String Message MessageExt**
   如果仅对MessageExt 处理 会导致部分使用 Message 的用户 无法收到 properties topic等信息 与 String 一样。
   希望 截图部分 增加对Message的额外处理。MessageExt 转换为Message即可 。


----------------------------------------------------------------
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] [rocketmq-spring] wbzj1110 commented on issue #346: DefaultRocketMQListenerContainer 仅对MessageExt做了处理没有对Message做额外处理不太妥当

Posted by GitBox <gi...@apache.org>.
wbzj1110 commented on issue #346:
URL: https://github.com/apache/rocketmq-spring/issues/346#issuecomment-772191278


    if (Objects.equals(messageType, MessageExt.class) || Objects.equals(messageType, Message.class)) {
               return messageExt;
           }
   即可。。。


----------------------------------------------------------------
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] [rocketmq-spring] RongtongJin commented on issue #346: It is not appropriate for the DefaultRocketMQListenerContainer to only process the messageExt without additional processing of the message

Posted by GitBox <gi...@apache.org>.
RongtongJin commented on issue #346:
URL: https://github.com/apache/rocketmq-spring/issues/346#issuecomment-778621652


   在[Wiki最佳实践第7条](https://github.com/apache/rocketmq-spring/wiki/%E5%B8%B8%E8%A7%81%E9%97%AE%E9%A2%98)中推荐使用的是messageExt,这可以包含所有原生的RocketMQ Message的信息。
   
   不过增加对RocketMQ Message的额外处理确实能帮助到那些误用Message的用户,你能提交一个PR来改善这个问题吗?
   


----------------------------------------------------------------
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] [rocketmq-spring] RongtongJin commented on issue #346: It is not appropriate for the DefaultRocketMQListenerContainer to only process the messageExt without additional processing of the message

Posted by GitBox <gi...@apache.org>.
RongtongJin commented on issue #346:
URL: https://github.com/apache/rocketmq-spring/issues/346#issuecomment-781893325


   > #349 您好 pr 提了。。烦请得空check一下。
   > 
   > 还有 能问下,这个问题以外的,
   > 1)、关于spring-boot-rocketmq 这个项目没有计划支持全链路吗?我们这边对全链路做了补全。以切面的方式使用brave支持的。以独立jar包引入。。类似于打补丁了。
   > 2)、关于@async标签,其实底层用rocketmq 实现比放入线程池的方式好不少。
   > 我们这边也有实现,但是发现貌似都不太适合提到这个项目中,不知道有咩有计划开一个类似于rocketmq 的externals 的玩法,把大家的研发过程 搞出来的内部使用,同时纯技术方面对rocketmq 生态使用有一定帮助的积累一下?
   
   已经合并。RocketMQ有一个[externals](https://github.com/apache/rocketmq-externals)的仓库存放了一些未孵化的项目,是否合适放入该仓库? 这里的全链路指的是做了指标的监控和暴露吗?


----------------------------------------------------------------
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] [rocketmq-spring] wbzj1110 commented on issue #346: DefaultRocketMQListenerContainer 仅对MessageExt做了处理没有对Message做额外处理不太妥当

Posted by GitBox <gi...@apache.org>.
wbzj1110 commented on issue #346:
URL: https://github.com/apache/rocketmq-spring/issues/346#issuecomment-772194774


   当然如果用instanceof 可以忽略子类的判断。不过性能上不知道是否有区别。


----------------------------------------------------------------
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] [rocketmq-spring] wbzj1110 commented on issue #346: It is not appropriate for the DefaultRocketMQListenerContainer to only process the messageExt without additional processing of the message

Posted by GitBox <gi...@apache.org>.
wbzj1110 commented on issue #346:
URL: https://github.com/apache/rocketmq-spring/issues/346#issuecomment-780259320


   好的!您稍等。


----------------------------------------------------------------
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] [rocketmq-spring] wbzj1110 commented on issue #346: It is not appropriate for the DefaultRocketMQListenerContainer to only process the messageExt without additional processing of the message

Posted by GitBox <gi...@apache.org>.
wbzj1110 commented on issue #346:
URL: https://github.com/apache/rocketmq-spring/issues/346#issuecomment-781121764


   关于对 message这部分信息没有补上去,我们这就是在对rocketmq全链路补全的部分,发现一部分研发再使用Message的全链路没有拿到,所以才发现的这个问题,觉得可能加上会好一些,所以才提的这个issue。


----------------------------------------------------------------
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] [rocketmq-spring] RongtongJin closed issue #346: It is not appropriate for the DefaultRocketMQListenerContainer to only process the messageExt without additional processing of the message

Posted by GitBox <gi...@apache.org>.
RongtongJin closed issue #346:
URL: https://github.com/apache/rocketmq-spring/issues/346


   


----------------------------------------------------------------
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] [rocketmq-spring] wbzj1110 commented on issue #346: It is not appropriate for the DefaultRocketMQListenerContainer to only process the messageExt without additional processing of the message

Posted by GitBox <gi...@apache.org>.
wbzj1110 commented on issue #346:
URL: https://github.com/apache/rocketmq-spring/issues/346#issuecomment-781119244


   https://github.com/apache/rocketmq-spring/pull/349   您好 pr 提了。。烦请得空check一下。
   
   还有 能问下,这个问题以外的,
   1)、关于spring-boot-rocketmq 这个项目没有计划支持全链路吗?我们这边对全链路做了补全。以切面的方式使用brave支持的。以独立jar包引入。。类似于打补丁了。
   2)、关于@Async标签,其实底层用rocketmq 实现比放入线程池的方式好不少。
   我们这边也有实现,但是发现貌似都不太适合提到这个项目中,不知道有咩有计划开一个类似于rocketmq 的externals 的玩法,把大家的研发过程 搞出来的内部使用,同时纯技术方面对rocketmq 生态使用有一定帮助的积累一下?


----------------------------------------------------------------
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] [rocketmq-spring] wbzj1110 commented on issue #346: It is not appropriate for the DefaultRocketMQListenerContainer to only process the messageExt without additional processing of the message

Posted by GitBox <gi...@apache.org>.
wbzj1110 commented on issue #346:
URL: https://github.com/apache/rocketmq-spring/issues/346#issuecomment-781911360


   > > #349 您好 pr 提了。。烦请得空check一下。
   > > 还有 能问下,这个问题以外的,
   > > 1)、关于spring-boot-rocketmq 这个项目没有计划支持全链路吗?我们这边对全链路做了补全。以切面的方式使用brave支持的。以独立jar包引入。。类似于打补丁了。
   > > 2)、关于@async标签,其实底层用rocketmq 实现比放入线程池的方式好不少。
   > > 我们这边也有实现,但是发现貌似都不太适合提到这个项目中,不知道有咩有计划开一个类似于rocketmq 的externals 的玩法,把大家的研发过程 搞出来的内部使用,同时纯技术方面对rocketmq 生态使用有一定帮助的积累一下?
   > 
   > 已经合并。RocketMQ有一个[externals](https://github.com/apache/rocketmq-externals)的仓库存放了一些未孵化的项目,是否合适放入该仓库? 这里的全链路指的是做了指标的监控和暴露吗?
   
   指标的监控与暴露与spring-boot的zipkin那套已经有了。只不过由于rocketmq没有补全,导致全链路断开了。
   我举个例子,拿spring-boot的feign,A服务通过feign调用B,feign会自动的获取A服务的当前traceId【唯一标记】,添加到头部,然后B服务会解析头部,如果有这个唯一标示,那么会自动使用这个traceId。
   表现为:
   1)、拿着此traceId,可以直接去zipkin-server查询整个链路以及耗时情况
   2)、拿着此traceId,如果log日志格式定义支持traceId打印,直接在kibana搜索出整个服务的日志。跨N个链路的情况下会非常方便。
   ![image](https://user-images.githubusercontent.com/11921135/108476423-fa1c8500-72cc-11eb-8bdd-bdcb2f1700a4.png)
   
   把http替换为mq其实是类似的。kafka是支持这个功能的,这部分是需要社区来补充的。rocketmq 我这边作为一个基于此使用的,直接内部fix社区代码,然后内部使用,不太方便跟着社区后续的更新,所以初步采用的是切面方式做的补充,等于是打补丁了。其实spring-boot-rocketmq-starter项目直接支持全链路肯定是更好地。
   
   ![image](https://user-images.githubusercontent.com/11921135/108476144-aa3dbe00-72cc-11eb-9d43-391c475bbda2.png)
   
   感谢您的回复。还有@Async标签这个功能,我与公司内部的技术老大与法规部沟通下,争取上传到 rocketmq的https://github.com/apache/rocketmq-externals 上。 我一开始以为是rocketmq的直接扩展,然后我这边大部分都要围绕着spring-boot与rocketmq结合与以后的玩法,嘿嘿想多了。
   
   


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