Apache ActiveMQ Artemis 持久订阅 TTL

Apache ActiveMQ Artemis Durable Subscription TTL

我想配置持久主题,但我想配置 Apache ActiveMQ Artemis 为该主题的非活动持久订阅者保留消息的时间。

例如,"Save durable messages for up to 30 seconds for inactive durable subscribers"。如果订阅者在 30 秒内未激活,则在他们激活后消息将不再可用。

这是可以做到的吗?如果没有,Artemis 或 JMS 是否提供替代方法来完成此操作或类似操作。

ActiveMQ Artemis 并不完全具备您正在寻找的功能,但您可以使用 expiry-delay address-setting 来接近它,它将对还没有的消息应用过期时间设置它们的到期时间。请参阅 the documentation 中的配置详细信息。这将确保消息过期而不是在不活动的持久订阅中累积。