>
Yes, I would suggest to use an increasing timeout. Starting with zero, up to a maximum. That isn't an uncommon pattern. 
Sounds reasonable. 
  
So, thanks for the input. I've created a Hono issue for this: 
https://github.com/eclipse/hono/issues/1210 
  
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 
 
 
 
 
From: hono-dev-bounces@xxxxxxxxxxx <hono-dev-bounces@xxxxxxxxxxx>
On Behalf Of Jens Reimann 
Sent: Donnerstag, 25. April 2019 18:05 
To: hono developer discussions <hono-dev@xxxxxxxxxxx> 
Subject: Re: [hono-dev] Reconnect interval 
 
 
  
Yes, I would suggest to use an increasing timeout. Starting with zero, up to a maximum. That isn't an uncommon pattern. 
 
A simple pattern could be: 
 
On connect, reset relay to "min". On connection failure increment the delay if it is below "max". 
 
 
  
I'm not actually a developer here, so take this with a grain of salt, but this sounds like something an exponential back-off could address properly. I.e., wait x milliseconds, then 2x, then 4x... etc. 
 
Cheers, 
Bor 
 
-----Ursprüngliche Nachricht----- 
Von: hono-dev-bounces@xxxxxxxxxxx <hono-dev-bounces@xxxxxxxxxxx> Im Auftrag von Kai Hudalla 
Gesendet: Donnerstag, 25. April 2019 17:03 
An: hono-dev@xxxxxxxxxxx 
Betreff: Re: [hono-dev] Reconnect interval 
 
On Thu, 2019-04-25 at 14:21 +0000, Lohmann Carsten (INST/ECS4) wrote: 
> 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. 
> 
> 
 
sounds reasonable 
 
> 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. 
 
What about simply setting it to 0 in our example deployment? People could then still decide whether they want to adjust it according to their needs? 
 
> 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 
> 
> 
> 
> _______________________________________________ 
> hono-dev mailing list 
> hono-dev@xxxxxxxxxxx 
> To change your delivery options, retrieve your password, or 
> unsubscribe from this list, visit 
> https://www.eclipse.org/mailman/listinfo/hono-dev 
 
_______________________________________________ 
hono-dev mailing list 
hono-dev@xxxxxxxxxxx 
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/hono-dev 
_______________________________________________ 
hono-dev mailing list 
hono-dev@xxxxxxxxxxx 
To change your delivery options, retrieve your password, or unsubscribe from this list, visit 
https://www.eclipse.org/mailman/listinfo/hono-dev 
 
 
 
 
--  
Jens Reimann 
Principal Software Engineer / EMEA ENG Middleware 
Werner-von-Siemens-Ring 14 
85630 Grasbrunn 
Germany 
phone: +49 89 2050 71286 
_____________________________________________________________________________ 
 
Red Hat GmbH, www.de.redhat.com, 
Registered seat: Grasbrunn, Commercial register: Amtsgericht Muenchen, HRB 153243, 
Managing Directors: Paul Argiry, Charles Cachera, Tom Savage, Michael O'Neill 
 
 
 
 
 
 
 
 
 |