We're using ActiveMQ from Python, STOMP as protocol, and trying support receiving topic updates after a consumer connects.
We've managed to trigger the RetainedMessageSubscriptionRecoveryPolicy (probably intended for MQTT) by setting the STOMP header ActiveMQ.Retain=true, and this works with retroactive consumers.
What we haven't got working is setting a per-message expiry when requesting retain. According to the docs we should be able to use the expires header, but it appears this might either not be for topics, or might not work when retain is enabled.
We're wondering if there's a way to get retain behaviour but with a per-message expiry. So far we've experimented with TimedSubscriptionRecoveryPolicy and inactiveTimoutBeforeGC, which sort of works, but has to be configured at the topic level, rather than the message level. This also doesn't retain only the latest message to a topic, which is another behaviour we'd like.
Is there a way to do this with:
- Retroactive topic subscription
- Supporting message TTL (and GCing the topic too when it's idle, if possible)
- Last image caching
all at once? The closest approximation would appear to be just using retain with clients checking the expires header (which is delivered with the message) and disregarding out of date messages, combined with a GC on the topics.
Any help appreciated!