RockteMQ-AI commented on issue #743: URL: https://github.com/apache/rocketmq-spring/issues/743#issuecomment-5192829232
**Issue Evaluation** Category: `enhancement` | Status: **Evaluated** Calling `applicationContext.getBean()` on every message dispatch does have a minor overhead. However, Spring's `getBean()` for singleton beans is very fast (essentially a HashMap lookup after the first call) — the bean is already cached. **That said**, moving the bean lookup to initialization time (`afterPropertiesSet` / `@PostConstruct`) would eliminate even that minor overhead and is a reasonable optimization. **Feasibility:** Feasible. The listener container can resolve required beans during `InitializingBean.afterPropertiesSet()` and cache them as instance fields. --- *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]
