Coder Social home page Coder Social logo

kafka-retries's Introduction

Contributors Forks Stargazers Issues MIT License LinkedIn


Logo

Non-Blocking Retries in Kafka

An awesome README template to jumpstart your projects!
Explore the docs »

View Demo · Report Bug · Request Feature

Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. Contributing
  5. License
  6. Contact
  7. Acknowledgments

About The Project

Product Name Screen Shot

There are many great README templates available on GitHub; however, I didn't find one that really suited my needs so I created this enhanced one. I want to create a README template so amazing that it'll be the last one you ever need -- I think this is it.

Here's why:

  • Your time should be focused on creating something amazing. A project that solves a problem and helps others
  • You shouldn't be doing the same tasks over and over like creating a README from scratch
  • You should implement DRY principles to the rest of your life 😄

Of course, no one template will serve all projects since your needs may be different. So I'll be adding more in the near future. You may also suggest changes by forking this repo and creating a pull request or opening an issue. Thanks to all the people have contributed to expanding this template!

Use the BLANK_README.md to get started.

(back to top)

Built With

  • Spring
  • Redis
  • Kafka

(back to top)

Getting Started

This is an example of how you may give instructions on setting up your project locally. To get a local copy up and running follow these simple example steps.

Installation

Below is an example of how you can instruct your audience on installing and setting up your app. This template doesn't rely on any external dependencies or services.

  1. Install docker

    docker compose up -d
  2. Install RedisInsight to view DB

  3. Init data in KafkaRetryTest.java

    @Test
     void initTransaction(){
         TransactionRequest transactionRequest = TransactionRequest.builder()
                 .phoneNumber("254986890007")
                 .transactionRequestId("08d97d43-c1f3-42c1-b8cc-6b1f7e5a8b44")
                 .status(CONFIRMED)
                 .build();
         transactionRequestRepository.save(transactionRequest);
         System.out.println("init success");
     }
  4. Run the application

(back to top)

Usage

Call API to execute the function

curl --location 'http://localhost:2645/transaction' \
--header 'Content-Type: application/json' \
--data '{
     "phoneNumber": "254986890007"
 }'

Assuming we want to have the following retrying strategy:

  • Retry 4 times in first 1 hour
  • 2 times - 5 minutes
  • 1 times - 20 minutes
  • 1 times - 30 minutes
  • Then we skip the message

Now we can create 3 separate topics for retry logic handling, each for only one delay value:

  • ‘retry_5m_topic’ — for retry in 5 minutes
  • ‘retry_20m_topic’ — for retry in 20 minutes
  • ‘retry_30_topic’ — for retry in 30 minutes

For more examples, please refer to the Documentation

(back to top)

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

(back to top)

License

Distributed under the MIT License. See LICENSE.txt for more information.

(back to top)

Contact

Your Name - @your_twitter - [email protected]

Project Link: https://github.com/your_username/repo_name

(back to top)

References

(back to top)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.