How to re-register a WAMP message after reconnecting using Autobahn Python with Twisted ReconnectingClientFactory?

I have an Autobahn Python client application using Twisted that is connected to the Crossbar.io server. The client application can successfully reconnect after losing a network connection using ReconnectingClientFactory. The client registers the name of the called party when connected, so that other applications can call it. This always works the first time you connect.

However, when recovering from a lost connection, the name of the called party cannot be re-registered, since the name of the called party is still registered from the previous lost connection. This results in the error "wamp.error.procedure_already_exists". Since the registration of the called name is still related to the previous lost connection, I must unregister the old name of the called party.

The only solution that I see is to create and register a unique new name for the called party in each connection, in order to avoid a collision with previously registered names of the called parties.

Is there a better or easier way to handle this? It seems that the WAMP protocol allows you to unregister the name of the called party from another connection using the registration identifier, but the Autobahn Python client library does not seem to allow this.

+6
source share
1 answer

I asked the wrong question. The Crossbar.io server should detect when the client is disconnected and automatically cancel accounts belonging to the disconnected session (for Tobias Oberstien on Twitter: https://twitter.com/oberstet/status/642241167216746496 ). This is not the responsibility of Autobahn customers.

My problem was that my Crossbar.io server did not detect client disconnections that occur when the network connections of clients were suddenly disconnected, so cleaning did not occur.

This behavior is simply due to the configuration of the Crossbar server. Since then, I have followed the โ€œproduction settingsโ€ example registered on the Crossbar website ( http://crossbar.io/docs/WebSocket-Options/ ). Now I have the behavior that I was looking for when the sessions remaining after a broken connection are detected and cleared automatically.

+6
source

All Articles