apache / rocketmq-spring

Apache RocketMQ Spring Integration
https://rocketmq.apache.org/
Apache License 2.0
2.09k stars 894 forks source link

sendAndReceive方法能否接收到响应,对于消费者和生产者的启动顺序是否有要求? #640

Closed Khao-thin closed 6 months ago

Khao-thin commented 6 months ago

在项目中使用2.2.2版本的rocketmq-spring-boot-starter,使用sendAndReceive方法获取响应 情况1:当生产者在消费者服务启动后启动,可以正常获取到reply 情况2:当生产者在消费者服务启动前启动,每条消息都无法获取到reply,报错日志如下, org.springframework.messaging.MessagingException: CODE: 10006 DESC: send request message to OK, but wait reply message timeout, 3000 ms.; nested exception is org.apache.rocketmq.client.exception.RequestTimeoutException: CODE: 10006 DESC: send request message to OK, but wait reply message timeout, 3000 ms. (经测试该错误不是由消费者执行时间过长引起)

panzhi33 commented 6 months ago

使用这个方法,必须先启动consumer