ActiveMQ 是否有响应式客户端库或使用 spring WebClient 获取消息的方法?

Does ActiveMQ have a reactive client library or a way to get messages with spring WebClient?

我正在使用 Spring Webflux 和 Reactor Netty 开发 NIO SMTP 客户端。我有一个要求将消息集成到应用程序中,我想知道是否有一种非阻塞的方式来与 ActiveMQ 交互,我发现唯一在 ActiveMQ 中提到 NIO 的文档只谈论 ActiveMQ 服务器如何使用 NIO 模型,但没有关于使用非阻塞客户端使用服务。

当然,与任何其他 JMS 提供程序一样,ActiveMQ 具有阻塞 API(MessageConsumer.receive()) as well as a method to setup a MessageListener that is called automatically once a message arrives. Since you are using Spring, take a look at this 示例。

此外,您可以使用 'nio' 而不是 tcp 前缀来启用 server-side NIO:nio://hostname:port?key=value,另请参阅 https://activemq.apache.org/nio-transport-reference,但是听起来 NIO 仅在 client-server 通信的服务器端实现。