Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support "WAMP AP Retained Events" for pattern-based subscriptions #1242

Open
jamesremuscat opened this issue Jan 23, 2018 · 2 comments
Open

Comments

@jamesremuscat
Copy link

jamesremuscat commented Jan 23, 2018

(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:

  • 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).

@jamesremuscat
Copy link
Author

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 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
@oberstet
Copy link
Contributor

oberstet commented 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, ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants