hono icon indicating copy to clipboard operation
hono copied to clipboard

HonoClientImpl does not notify user on re-connection

Open DanielMaier-BSI opened this issue 7 years ago • 2 comments

Hono offers the possibility to let HonoClient handle re-connection after connection loss (after previous successful connection establishment) by setting reconnectAttempts on ProtonClientOptions.

This works well for me on initial connection establishment and also if I use the client only for sending data. However if I want to use the client as receiver, e.g. telemetry consumer, I need to establish a new receiver link after the re-connect somehow.

I don't see a possibility with the current HonoClientImpl as I don't have a way to let me notify about further connection establishments. The only way I see to reach this, is to implement re-connection with disconnectHandler on myself. Is this correct?

If this is correct it would be nice to have some kind of handler that gets notified on re-connects to give the user the possibility to re-create telemetry consumer etc. Or would it be even worth considering doing the re-creation automatically by Hono?

Thanks Daniel

DanielMaier-BSI avatar Apr 05 '18 12:04 DanielMaier-BSI

Would you mind to create a PR for that?

sysexcontrol avatar Aug 23 '18 13:08 sysexcontrol

We have now implemented our own re-connection handler that also re-establishes receiver link. If no one else is interested in this feature I can close this issue. How did you solve this for command and control receiver links?

DanielMaier-BSI avatar Sep 17 '18 06:09 DanielMaier-BSI