Closed hawkowl closed 7 years ago
Yes, feature announcement (message_retention == true
) from router side is another piece here. I think this essentially completes the spec of this feature.
Maybe we need an error URI for when the router is allowing a client to publish to the topic, but is not willing to let a particular client publish to a topic with the retain flag set (and the client used acknowledge publication - otherwise it doesn't get the error feedback anyway). But this is a minor thing (and depends on whether we want to let the router admin control this feature at that granularity.
Yeah, I think that's all we'll need. I'll have a look at AB|P and Crossbar, I don't think there'll be any issues implementing it...
I feel like the error URI is unneeded, I can't think of a use case where you'd allow a client to publish to a topic but not change the topic's retain message.
@oberstet , from the crossbar issue:
If requested, router should publish the last event on the subscription (we have an object inside the broker already for that) to that particular client (via eligible).
How do you see this working? Would this allow multiple retained messages, for example, in order of the broker receiving them (all with retain = true):
And then when authid 'baz' connects, they get message #3, authid bar gets #2 on connection, and everyone else gets #1 on connection? And then, if there were a fourth message, eligible to all, it would become the only retained message?
Either that, or there's only one retained message, and clients that aren't eligible just don't get it. I'm not sure, I think the prior option is better, if a little more complicated, as then a single eligible message being retained doesn't make it useless for the rest of the clients.
I think the former of those two options makes the most sense to a user, so I did up a draft in a PR which defines it: https://github.com/wamp-proto/wamp-proto/pull/262
Haven't written anything like this before so I just tried to copy the style what was there :P
The multiple-retained-messages question only affects the broker, though, so stay tuned for AB|P changes, which we will need first anyway...
I feel like the error URI is unneeded, I can't think of a use case ...
Ok, agreed. Screw the error URI.
I think we can close this now...
See https://github.com/crossbario/crossbar/issues/887 for more details, but it seems like we need to define:
Publish.Options.retain|bool
(to set it as the topic's retained message, default is False)Subscribe.Options.get_retained|bool
(to request the retained message along with the subscription)Event.Details.retained|bool
(to say that it is a retained message, and not a new message)And maybe advertise via
Welcome.Roles.broker.message_retention := true
?cc @oberstet