Spring Cloud Stream 的 Solace 活页夹支持直接、非持久消息传递

Support for direct, non-durable messaging with Solace binder for Spring Cloud Stream

我有一个 Spring Boot 2 应用程序,它只充当消息发布者和另一个 Spring Boot 2 应用程序,它只充当消息消费者。

由于每条消息都代表一个非关键的事件通知,因此不必保证消费者应用程序收到来自生产者的每条消息,因此我想使用以下设置:

在研究配置选项时,我尝试定义输入目的地 (spring.cloud.stream.bindings.input.destination),无论是否使用消费者组,结果如下:

这两个选项的异常表明 durable/guaranteed 目标绑定,这不是我想要的。

我的问题是 Spring Cloud Stream 的 Solace 活页夹是否支持非持久场景?

如果 SCS 绑定器不支持,我能否在改用 Solace JMS 后实现我的目标?

正如您在我们网站上看到的那样,Solace 活页夹是 partner maintained, so I would consider raising an issue directly with them

我相信你有两个选择:

  1. 如果没有指定消费者组,Solace Spring Cloud Streams 活页夹将创建一个订阅您感兴趣的主题的临时队列。这是您的 SCS 应用程序将绑定的位置。此队列仅在客户端会话期间存在,因此它将在您的应用程序关闭后被删除。但是,当您的应用程序仍在运行时,使用队列会带来额外的好处,即消息不会在网络反弹期间丢失,或代理的 HA 故障转移(如果您配置了 HA)。请注意,因为队列是一个有保证的端点,所以您的代理 & client-profile 需要配置为保证交付。大多数经纪商现在都为此进行了配置,但您需要确保您的 client-profile 选中了以下选项:"guaranteed endpoint create"、"guaranteed message receive" 和 "guaranteed message send"

  2. 如果第一个选项对您不起作用,那么您可以使用 JMS 创建主题订阅是正确的。这里也有一些选项——你可以使用 Solace 的 Spring 启动自动配置,你可以在这里找到它:https://github.com/SolaceProducts/solace-jms-spring-boot or if you prefer to create your own JMS artifacts an example for how to do that can be found in the "Receiving a message" section here: https://solace.com/samples/solace-samples-jms/publish-subscribe/