RockteMQ-AI commented on issue #620: URL: https://github.com/apache/rocketmq-spring/issues/620#issuecomment-5653758532
**Issue Evaluation** Category: `question` | Status: **Answered** This is expected behavior in `rocketmq-spring-boot-starter`. When the application starts, the producer/consumer beans attempt to initialize their connections to the broker. If the broker is unreachable, the startup fails because the bean initialization throws a connection exception. **Options to handle this:** 1. **Ensure broker availability** — Start RocketMQ before the Spring Boot application. This is the standard deployment order. 2. **Lazy initialization** — You can defer the RocketMQ bean initialization by using `@Lazy` on the producer/consumer injection points, so the connection is only attempted when first used (not at startup). 3. **Custom error handling** — Wrap the RocketMQ configuration in a `@ConditionalOnProperty` or `@Profile` so it can be disabled in environments where the broker is not available. 4. **Upgrade** — Newer versions of `rocketmq-spring-boot-starter` (2.3.x+) have improved connection resilience. Consider upgrading from 2.2.3. This is not a bug — it is the designed startup behavior. Closing as a question. --- *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]
