You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've noticed some interesting edge cases around retained events and pattern-based subscriptions. As an example, take this scenario:
Node 1 publishes message A to topic myprefix.A with PublishOptions(retain=True)
Node 1 publishes message B to topic myprefix.B with PublishOptions(retain=True)
Node 2 subscribes to myprefix with SubscribeOptions(match='prefix', get_retained=True)
My naive expected behaviour was that Node 2 would immediately receive messages A and B. In actual fact, Node 2 receives no messages.
The spec suggests that, at the least, Node 2 should receive message B:
When they opt-in to receiving the Retained Event, the Broker MUST send the Subscriber the most recent Retained Event that they would have received if they were subscribing when it was published.
(emphasis original) - "if they were subscribing when it was published" here includes both messages A and B, the most recent of which is B.
A further observation is that, if now Node 1 publishes message C to topic myprefix.C with PublishOptions(retain=True), then Node 2 receives the message, but the EventDetails object has retained=False, whereas I would have expected it to contain retained=True.
It looks like retained events are only really supported for exact-match subscriptions - https://github.com/crossbario/crossbar/blob/master/crossbar/router/broker.py#L457 doesn't include a match argument in the call to get_observation, so it defaults to exact. Retained events are stored against observations, rather than "bound to the topic it was sent to" (spec).
The text was updated successfully, but these errors were encountered:
Just a note to say that I'm still working around this in user-space, and have needed to on a number of projects over the last 4.5 years; if there was a way of this being resolved in Crossbar I'd be hugely grateful!
oberstet
changed the title
Retained events don't work with pattern-based subscriptions
Support "WAMP AP Retained Events" for pattern-based subscriptions
Aug 9, 2022
Yeah, there is a whole bunch of such "smaller" issues/gaps/glitches, where only something of limited scope is missing in Crossbar.io:( Lack of resources, curse of OSS, no sponsors, ...
(From https://groups.google.com/forum/#!msg/crossbario/xjYjd3oCkQg/bKOl6wTDAgAJ)
I've noticed some interesting edge cases around retained events and pattern-based subscriptions. As an example, take this scenario:
myprefix.A
withPublishOptions(retain=True)
myprefix.B
withPublishOptions(retain=True)
myprefix
withSubscribeOptions(match='prefix', get_retained=True)
My naive expected behaviour was that Node 2 would immediately receive messages A and B. In actual fact, Node 2 receives no messages.
The spec suggests that, at the least, Node 2 should receive message B:
(emphasis original) - "if they were subscribing when it was published" here includes both messages A and B, the most recent of which is B.
A further observation is that, if now Node 1 publishes message C to topic
myprefix.C
withPublishOptions(retain=True)
, then Node 2 receives the message, but theEventDetails
object hasretained=False
, whereas I would have expected it to containretained=True
.It looks like retained events are only really supported for exact-match subscriptions - https://github.com/crossbario/crossbar/blob/master/crossbar/router/broker.py#L457 doesn't include a
match
argument in the call toget_observation
, so it defaults toexact
. Retained events are stored against observations, rather than "bound to the topic it was sent to" (spec).The text was updated successfully, but these errors were encountered: