创建一个库以创建 rabbit spring 个 bean

Creating a library to have rabbit spring beans created

我正在创建一个连接到不同 MQ 代理(如 Rabbit MQ)的消息总线 jar。许多应用程序将使用该 jar 来发送和接收来自 Rabbit 的消息。 虽然发送消息按我的应用程序预期的那样工作,但不清楚如何设计侦听器。显然 @RabbitListener 在 jar 中,但我希望消息应该到达应用程序中的 class。 任何建议表示赞赏。 有没有更好的方法来为 rabbit spring 创建一种总线库并在应用程序中使用。

听起来你需要熟悉一下 https://spring.io/projects/spring-integration. And also take a look, please, into this project which already implements something similar: https://spring.io/projects/spring-cloud-bus