Event for updating newly subscribed clients?

#1

Hi,

I try to implement an application using crossbar and autobahnJS where multiple web clients are synced by an node.JS API.

Let’s suppose I only want to sync one value. There is absolutely no problem once all clients have established a subscription. Then I can easily publish the new value and every client gets notified. But don’t know how to handle the case when a new client subscribes to a topic because it doesn’t know the actual value until the next value change that is published by the API.

Is there any known approach for this issue apart from registering a procedure by the API that is called by any new client when it subscribes to a topic? I played around with the wamp.subscription.on_subscribe meta event which basically works but using that I have no clue which topic/URI the client subscribed to (there are several topics that should implement this behaviour) or did I miss something in the docs?

I look forward to any help. Thank you for creating this great piece of software. :slight_smile:

0 Likes

#2

Hi,

I try to implement an application using crossbar and autobahnJS where
multiple web clients are synced by an node.JS API.

Let's suppose I only want to sync one value. There is absolutely no problem
once all clients have established a subscription. Then I can easily publish
the new value and every client gets notified. But don't know how to handle
the case when a new client subscribes to a topic because it doesn't know
the actual value until the next value change that is published by the API.

Is there any known approach for this issue apart from registering a
procedure by the API that is called by any new client when it subscribes to
a topic? I played around with the wamp.subscription.on_subscribe meta event
which basically works but using that I have no clue *which* topic/URI the
client subscribed to (there are several topics that should implement this
behaviour) or did I miss something in the docs?

This exact use case is covered using a feature of Crossbar.io (and in AutobahnPython and JS) called "retained events".

Please see here for an example

https://github.com/crossbario/crossbar-examples/tree/master/pubsub/retained#event-retention

I look forward to any help. Thank you for creating this great piece of
software. :slight_smile:

Thanks :slight_smile:

Tobias

···

Am 10.07.2017 um 21:52 schrieb Piet Petterson:

0 Likes