crossbario / crossbar

Crossbar.io - WAMP application router
https://crossbar.io/
Other
2.05k stars 275 forks source link

PubSub not working between RLink connected routers #2053

Closed Skully17 closed 1 year ago

Skully17 commented 1 year ago

We are having an issue with publish in crossbar io 22.6.1 and previous versions with Rlinks. We require Rlinks to forward local topic publications and RPC’s to cloud and vice versa.

Setup: There is a crossbar router running on a local machine and another running on an AWS machine. Both have connected JS clients using Autobahn-JS which have 4 buttons to:

  1. Subscribe to “com.browser.hub”
  2. Subscribe to “com.browser.cloud”
  3. Publish to “com.browser.hub”
  4. Publish to “com.browser.cloud”

Steps:

  1. On the cloud machine, I subscribe to “com.browser.cloud” then subscribe to “com.browser.hub”
  2. On the local machine, I subscribe to “com.browser.cloud” then subscribe to “com.browser.hub”
  3. On the cloud machine, I publish to “com.browser.cloud” then publish to “com.browser.hub”
  4. On the local machine, I publish to “com.browser.cloud” then publish to “com.browser.hub”

You can see from the logs that the first 3 publishes are successfully sent to 2 receivers (sub on local and cloud) but the last one only goes to 1 receiver (sub on local): image image image image This means that the second subscription is not being forwarded over the RLink. When making the subscriptions, this error message always accompanies subscriptions that are failed to be forwarded: image I believe that there is an issue with the syncing of sub IDs over RLinks.

Skully17 commented 1 year ago

I found a poblem with how the subscription was being handled in rlink.py. I believe the wrong ID was being handled and stored for subscriptions being sent over the rlink. I changed the subscription code to work similar to registering, which was fixed in #1789, and it works for me. I have also made a PR for this change: #2055