RockteMQ-AI commented on issue #640: URL: https://github.com/apache/rocketmq-spring/issues/640#issuecomment-5736212498
## Issue Evaluation **Category:** `question` | **Status:** Answered This is a usage question about `sendAndReceive` and startup order requirements. **Answer:** The `sendAndReceive` (request-reply) pattern in RocketMQ requires that the **consumer (reply side) is started and ready before the producer sends the request**. Here is why: 1. The reply mechanism uses a temporary reply topic. The consumer listens on this topic and sends back a reply message. 2. If the producer starts first and sends a request, the reply consumer on the other side may not yet be registered to consume from the reply topic, causing the request to time out (`RequestTimeoutException: wait reply message timeout`). 3. **Recommended startup order:** Start the reply consumer service first, then start the producer/requester service. If you are experiencing timeouts with startup order scenario 2, this is expected behavior — the reply consumer needs to be subscribed and consuming before requests arrive. For production deployments, ensure all consumer services are healthy before starting producer services that depend on request-reply patterns. --- *Automated evaluation by @RockteMQ-AI* -- 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. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
