顺序消息消费第一次比较慢 #7241
Unanswered
mobaijaavaer
asked this question in
Q&A
顺序消息消费第一次比较慢
#7241
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
我使用4.5.2客户端版本,测试顺序消费场景,连接的server段是阿里云rocketmq商业版,我的程序代码如下:
`java
SimpleDateFormat simpleDateFormat=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
`
发现程序启动之后,消息很快发送出去了,但是每次需要过几十秒才能在客户端收到消息。目前定位到的原因主要可能是
![image](https://private-user-images.githubusercontent.com/121411673/262853063-57c7e5b4-96ef-48d5-b523-3efeeaee7f3e.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjYxMzMxMzYsIm5iZiI6MTcyNjEzMjgzNiwicGF0aCI6Ii8xMjE0MTE2NzMvMjYyODUzMDYzLTU3YzdlNWI0LTk2ZWYtNDhkNS1iNTIzLTNlZmVlYWVlN2YzZS5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwOTEyJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDkxMlQwOTIwMzZaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1jM2NlMGU0ZjdjNTdhODUxODI4MTJjZTRkNTU3M2UxZDMwNTRiOWFlYmJjMTA3NmQ1Y2QzZDk0NTc5ZDBiYTYwJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.Au5A8Lhcc5m7atnt79GZcA4XLXGIQuGaEUMM1upXC6I)
顺序消费需要对队列上锁,没有上锁的队列会放弃消息拉取,处理队列上锁的类是ConsumeMessageOrderlyService,默认20s执行一次,而客户端负载均衡也是20s, 通过在RebalanceImpl#lockAll 方法中打日志,发现首次启动后客户端没有任何队列,以下是控制台截图:
请教一下社区,有人遇到过此类问题吗?
Beta Was this translation helpful? Give feedback.
All reactions