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 2020/06/05 09:13:37 UTC

[GitHub] [rocketmq-externals] fibbery commented on issue #572: Failed to query message by Id

fibbery commented on issue #572:
URL: https://github.com/apache/rocketmq-externals/issues/572#issuecomment-639359374


   这个其实是rocketmq项目出现的问题,因为在消息内容转换成MessageView的时候,MessageExt的实际实现类是org.apache.rocketmq.common.message.MessageClientExt。代码点:org.apache.rocketmq.console.model.MessageView#fromMessageExt
   ![image](https://user-images.githubusercontent.com/8580606/83858328-e89b4900-a74e-11ea-8419-bd284eb7f15d.png)
   但是MessageExt是把getMsgId重写了的,代码如下:
   ![image](https://user-images.githubusercontent.com/8580606/83858428-0ff21600-a74f-11ea-9b8a-b63be558ec42.png)
   通常情况下,消息会有两个id,一个getOffsetMsgId(就是我们通常意义上说的在broker生成的唯一id),一个则是在producer端生成的唯一id( 存储在 property中键为UNIQ_KEY的值)
   实际上我们一直用的其实是offsetMsgId,我们在broker通过消息id查也是通过这个查询的。这里转换等于直接把一个我们不需要的id转换提供到前端去了。
   
   解决办法有两个,一个是在上述rocketmq-console的类转换处,手工set一下把id改掉,一个是在rocketmq-common项目处更改MessageClientExt的getMsgId方法(目前看不出这个额外类存在的必要)
   


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