Questions tagged [retry-logic]

Programming techniques designed to retry operations that failed due to error codes, exceptions, or other language specific means.

377 questions
2
votes
1 answer

How to retry HTTP POST requests

I have implemented the following code for retrying http post requests in Go. In second retry attempt, I always get request body as null. I have tried defer req.body.close() but it is not working. Can anyone please help me this issue? func…
Max2019
  • 100
  • 2
  • 7
2
votes
2 answers

Scala - Retry HTTP request with timeout

I wish to create a service where it makes an HTTP request to a specific URL, and if it doesn't get a result in 1 second, that request will timeout and then it will retry with another request, for maximum of 3 retries. How to implement this in…
TheOutsider
  • 63
  • 1
  • 10
2
votes
0 answers

netflix conductor - http type task - should not start with workflow - to achieve retry

I have created a task with retry of 5 times.And created a workflow using the task of http type(my rest url api endpoint) for input parameters. But the moment I run the workflow - it is hitting the rest api. where actually I want to run the task by…
Manu
  • 1,243
  • 5
  • 17
  • 43
2
votes
1 answer

C# ExponentialBackOff to Timespan Polly

I'm replacing my currenty retry policies with the Polly framework. I used to define my retry strategy like this: var strategy = new ExponentialBackoff(RetryStrategy.DefaultClientRetryCount, RetryStrategy.DefaultMinBackoff,…
pedrodotnet
  • 788
  • 3
  • 16
  • 34
2
votes
3 answers

how to write a junit test case for a method that has retry logic

The retry method precisely looks into a folder for a particular file and returns the file if present .It has a Max retry count for 3 and sleeps for 1 min between 2 retries .If after Max retries file is not present it throws some exception method is…
user8618585
  • 81
  • 1
  • 10
2
votes
1 answer

Retry function call n times when function throw exception in y interval of time

I wanted to retry my function call whenever it get failed in some duration of time. What is the best way do this. Is this will work fine. CompletableFuture.runAsync(() -> { for (int i = 0; i < 3; i++) { try { …
Rahul Anand
  • 165
  • 7
2
votes
3 answers

Is there a way I can delay the retry for a service bus message in an Azure function?

I have a function which pulls messages off a subscription, and forwards them to an HTTP endpoint. If the endpoint is unavailable, an exception is thrown. When this happens, I would like to delay the next attempt of that specific message for a…
2
votes
2 answers

RxJS retry entire chain

I read images from a live stream and select a batch periodically. I then send them to the server for validation. A HTTP error will be thrown if any fail validation. If that occurs I want to get a new batch of images. this.input.getImages() …
ovg
  • 1,486
  • 1
  • 18
  • 30
2
votes
1 answer

Retry on AmazonSQSClient

I'm using AmazonSQSClient to interact with the SQS service and using the default client configuration which means it already is using the DEFAULT_RETRY_POLICY. Let's say I make a call in my Java code to the "sendMessage" method. As per the doc, the…
vksinghh
  • 223
  • 4
  • 16
2
votes
1 answer

FCM: Retry-after and exponential backoff

As I understand, when a message fails to be delivered, the Retry-After header is sometimes included in the response and sometimes not. But what happens if I first receives an error response with Retry-After included, resends the message and receives…
2
votes
1 answer

Using C# Poly framework for Wcf retries, what exceptions are worth retrying?

Hi just looking at implementing Poly (found here https://github.com/App-vNext/Polly) in our wcf calls for 3rd party api calls. What exceptions types are worth creating the retry policy for? So far I have just got TimeoutException. Is there anymore…
Paul Cooke
  • 21
  • 4
1
vote
1 answer

Polly DecorrelatedJitterBackoffV2 - how calculate max time required to complete all retries?

We have a listener that receives a message from a Service Bus queue and then sends the body to an API. We use Polly for resilience in the cloud, namely the DecorrelatedJitterBackoffV2 policy. Our concern with this policy is that we are unsure of how…
Alasdair Stark
  • 1,227
  • 11
  • 32
1
vote
1 answer

Polly retry delay based on Service Bus Trigger value

I have an Azure function with a servicebustrigger as below [FunctionName("ServiceBusQueueTriggerCSharp")] public static void Run( [ServiceBusTrigger("myqueue", Connection = "ServiceBusConnection")] string myQueueItem, …
A B
  • 109
  • 1
  • 8
1
vote
1 answer

Populating unexported fields

I'm using this retry logic with a stop https://upgear.io/blog/simple-golang-retry-function/ My code looks like this type Stop struct { error } ... if s, ok := err.(Stop); ok { return s.error } ... I'm trying to get the Stop functionality…
jaekie
  • 2,283
  • 4
  • 30
  • 52
1
vote
1 answer

retry policy for python gRPC's

My retry policy is defined as options = [] retry_policy = { "methodConfig": [{ "name": [{"service": ""}], "retryPolicy": { "maxAttempts": 3, "initialBackoff": "1s", "maxBackoff": "10s", "backoffMultiplier": 2, …