Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[hono-dev] Reconnect interval

Hi,

I would like to get some opinions on how we should deal with the *reconnect interval* concerning AMQP connections between Hono components.

Currently, when for example the connection between a protocol adapter and the device registry fails or is closed, the re-connect attempt happens only after 500ms (that is the DEFAULT_RECONNECT_INTERVAL_MILLIS = 500).

I guess this was introduced for the scenario that the device registry is indeed unavailable and for example currently being (re)started, so that an immediately-after re-connect attempt would probably fail.

But, there are other scenarios:
- The device registry could be deployed with multiple instances (Kubernetes pods) and even if one instance is currently not responding, the next connection attempt could reach another, fully available instance.
- The device registry could have actively closed the connection with a "access token expired" response, meaning there is no reason to wait for a re-connect attempt.


IMHO, these two scenarios are quite common. I would therefore suggest to get rid of the reconnect interval altogether, always trying to re-connect immediately.
This would for example prevent the protocol adapters from giving out 503 Unavailable responses while waiting for the reconnect interval to elapse before connecting again to the device registry.

WDYT?


Best regards

Carsten Lohmann

Engineering Cloud Services 4 Bosch IoT Hub (INST/ECS4) 
Bosch Software Innovations GmbH | Ullsteinstr. 128 | 12109 Berlin | GERMANY | www.bosch-si.com

Sitz: Berlin, Registergericht: Amtsgericht Charlottenburg; HRB 148411 B 
Aufsichtsratsvorsitzender: Dr.-Ing. Thorsten Lücke; Geschäftsführung: Dr. Stefan Ferber, Michael Hahn, Dr. Aleksandar Mitrovic 





Back to the top