https://github.com/carloscharz/exponentialbackoff
Basic class to handle requests and resend them using exponential back-off
https://github.com/carloscharz/exponentialbackoff
backoff exponential strategy
Last synced: 11 months ago
JSON representation
Basic class to handle requests and resend them using exponential back-off
- Host: GitHub
- URL: https://github.com/carloscharz/exponentialbackoff
- Owner: carlosCharz
- Created: 2016-09-14T21:56:15.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2020-06-09T03:57:53.000Z (almost 6 years ago)
- Last Synced: 2025-06-24T04:41:17.324Z (12 months ago)
- Topics: backoff, exponential, strategy
- Language: Java
- Size: 17.6 KB
- Stars: 1
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Exponential back-off strategy
This is a base class to handle requests and resend them using exponential back-off.
In the source code you will find:
1. The class `BackOffStrategy.java`
2. The unit test`BackOffStrategyTest.java`
Basically, this code gives you an idea of how to implement an exponential back-off strategy to resend a request when there is an unsuccessful call. You can configure the number of retries and the default waiting time. In the unit test you will see some examples of how to use it. You can make it more complex according your development requirements (handle custom exceptions, wait more time, add some custom logic, etc).
This was my base class for the implementation of:
* A backend webservice with retry logic
* XMPP Connection Server for FCM(Firebase Cloud Messaging)
## Technology used
* Java 8
* JUnit 5
* Maven 3.6.x
## About me
I am Carlos Becerra, a very passionate developer. You can contact me via:
* [Google+](https://plus.google.com/+CarlosBecerraRodr%C3%ADguez)
* [Twitter](https://twitter.com/CarlosBecerraRo)
## License
```javas
Copyright 2020 Carlos Becerra
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.