Azure/azure-event-hubs-node

NodeJS: Node client should support some form of auto-retry for transient error

Closed this issue · 5 comments

From @hmlam on January 8, 2016 23:19

Looking through the code in develop branch it looks like we have not formally defined a good strategy for retry on transient error - something similar to the one we have in .Net. I think this is something that should be in the client layer (not in the Amqp layer). We are doing something similar in Java client so NodeJS should have the same behavior for feature parity.

Thanks

Copied from original issue: Azure/azure-event-hubs#13

From @noodlefrenzy on January 9, 2016 0:10

This makes sense to me. Do you have a link to the Java code that does retry? Are you thinking randomized exponential backoff or some other strategy?

From @hmlam on January 11, 2016 19:8

We are currently at design phase for the retry logic in the java client (@ https://github.com/Azure/azure-event-hubs/tree/javaClient) so no code yet. The current thinking is just to port the current functional logic from .Net to java (i.e. exponential backoff with some time-staggering build in). I think for NodeJS something similar is fine:

  • a simple randomized exponential backoff
  • only retry for known transient type AMQP error code (since we have not form of exception struct here).
  • only retry within the operation timeout period (actually I don't know if it is doable for this one, I don't think we have operation timeout concept in NodeJS?)

From @hmlam on January 15, 2016 19:43

I talked with our dev writing the Java API today and looks like he actually had a working code in the JavaClient branch for the retry policy, which you can take a look at @ https://github.com/Azure/azure-event-hubs/blob/javaClient/java/src/main/java/com/microsoft/azure/servicebus/RetryExponential.java

Let me know if you have questions on this.

Hello, do you have any plan on when to add the auto-retry?

@bryanch - Yes, we do support linear retries while sending an event. We have a new preview version "0.1.0" of the event hubs node.js client. This client was re-written from scratch. Please try the new version and let us know if you still see issues. You can find examples over here.