Questions tagged [retrywhen]

59 questions
2
votes
1 answer

RxJava2 using retryWhen with filter

I've been playing around with retryWhen() method and i noticed that if you use filter() inside retryWhen() and if filter() fails there's no callback executed not even onCompleted(). Can you please explain to me why is this happening? Thanks in…
Fatih Santalu
  • 4,641
  • 2
  • 17
  • 34
1
vote
0 answers

How do you mock an error response with MockWebServer while using retryWhen?

I am in the process of writing unit tests for a reactive API. I am using spring-boot 2.7.8 and mockwebserver 4.10.0. The method under test simply calls a third-party API with WebClient. I am having trouble writing the test for an error case. The…
D N
  • 11
  • 1
1
vote
1 answer

Can the retry operator catch errors like the retryWhen operator in RxJS?

Question is based off Reactive Patterns with RxJS for Angular by Lamis Chebbi. Chapter 5: Error Handling. In the section covering 'retrying strategies'. My problem stems from an example used in the book featuring the soon to be deprecated retryWhen…
sandedwich
  • 11
  • 2
1
vote
0 answers

how to update reactive WebClient object to have Retry policy at a central place

I have an already existing application, and we are making calls to other application from this. So, now, in our application we control the creation of WebClient object from a single place and then some other config are set on this like below : …
1
vote
0 answers

putting retry policy on reactive webclient

I am new to reactive programming. we have a spring boot application, in which we make sync and async calls. Now I want to put a common retry policy in those calls. We have only 1 place where we create webclient object, and then use it across the…
Onki
  • 1,879
  • 6
  • 38
  • 58
1
vote
1 answer

Troubleshooting Retry With Multiple Conditions

I currently have the below retry statement: * retry until karate.xmlPath(response, '//ResultCount') == 1 && karate.xmlPath(response, '//Code') == 0 If the retry fails, this message is printed: 'too many retry attempts: 10' The issue we are facing…
David A
  • 37
  • 3
1
vote
0 answers

How to retry method with button click?

I use an observable method that has dialog and I want to send retry message when failed. But after button clicked, it doesn't send retry message. How can I do it? getCompositeDisposable().add(repository.method().flatMap(resource -> { …
CEng
  • 53
  • 7
1
vote
2 answers

[RxJava]How to handle network error by `retryWhen()` on Android RxJava × retrofit2

I've trying https request on retrofit with RxJava When network is not available, I want to handle like this. 1, check network status. 2, if network is available, retry request 3, if network is not available, no retry -> after that, listen network…
Takaya.S
  • 23
  • 4
1
vote
0 answers

Rxjava retryWhen with delay not triggering retry

Observable call = Observable.create(emitter -> { emitter.onNext(1); emitter.onError(new Throwable("Error")); }); call .retryWhen(throwableObservable -> throwableObservable) .subscribe(integer -> System.out.println(integer),…
Serge
  • 143
  • 1
  • 7
1
vote
0 answers

Is there a way to clear rxjs timeout so that I can use retrywhen to retry an http request after allowing the user to login again without timing out?

If a user gets logged out by the server and the client still thinks that the user is logged in, I will get a 401 error code as expected. However I wish to temporarily "save" and retry the request that failed after the user has been prompted for…
weasnerb
  • 11
  • 2
1
vote
1 answer

how to fetch observables in parallel, wherein only one api call has a retry logic

I want to implement a logic using RxJava in my android application, which requires three parallel api calls. Only the third api call has a retry logic. If, after having three attempts, the success is achieved then a subsequent call will be made for…
Android1005
  • 155
  • 3
  • 14
1
vote
1 answer

Kotlin, RxJava2: compose and retryWhen after user interaction

during the last two days I read a lot about the rxJava retryWhen operator. Here, here, here and some more I forgot. But unfortunately I'm not able to get it work. What I'm trying to achive is, that I make an API call. If the call returns an error,…
Camino2007
  • 796
  • 10
  • 17
1
vote
0 answers

Angular retry http call only if error is the client

I'm new in angular and I would like to retry the http call if there is a network interruption or some error between client and server. At the moment I have this configuration like suggested by official documentation return…
luca
  • 3,248
  • 10
  • 66
  • 145
1
vote
1 answer

What's the usage of the observable emitted by retrywhen() in rxjava2?

I know that if the Observable emits a piece of data, it resubscribes, and if the Observable emits an onError notification, it passes that notification to the observer and terminates. The problem is that if I emit a Obervable.just(1,2),but it won't…
王鹏宇
  • 31
  • 6
1
vote
1 answer

HTTP Request retry on particular error using interceptor and retrywhen

I have a service that makes a call to GET API and receives a response back. I have implemented HTTP Interceptor to properly and globally handle any errors though out the application. I want to do is, when my API returns a particular error, say for…