Giter VIP home page Giter VIP logo

Comments (4)

ah-its-andy avatar ah-its-andy commented on July 21, 2024

Can you describe simply the solution you are working with to improve idempotence?

from cap.

yang-xiaodong avatar yang-xiaodong commented on July 21, 2024

@standardcore
In version 2.0, I have wapped the message content with Message class, Message object provider a Id property used to be guarantee message sequence, in consumer method we can check the Id whether it has been processed or not.

from cap.

yang-xiaodong avatar yang-xiaodong commented on July 21, 2024

This feature will be given to the user to ensure.

from cap.

yang-xiaodong avatar yang-xiaodong commented on July 21, 2024

CAP does not implement idempotent for several reasons: The following are the receiving end

    1. The message was successfully written, but the execution of the Consumer method failed.

There are many reasons why the Consumer method fails. I don't know if the specific scene is blindly retrying or not retrying is an incorrect choice.
For example: If the consumer is the debit service, if the execution of the deduction is successful, but the failure to write the debit log, the CAP will judge the consumer execution failure, and try again. If the client does not guarantee idempotency, the framework will retry it, which will inevitably lead to serious consequences for multiple deductions.

    1. the implementation of the Consumer method succeeded, but received the same message

The scenario here is also possible. If the Consumer has been successfully executed at the beginning, but for some reason, such as the Broker recovery, and received the same message, the CAP will consider this a new after receiving the Broker message. The message will be executed again by the Consumer. Because it is a new message, the CAP cannot be idempotent at this time.

    1. the current data storage mode can not be idempotent

Since the table of the CAP message is deleted after 1 hour for the successfully consumed message, if the historical message cannot be idempotent. Historically, it means that if the broker has maintained or manually processed some messages for some reason.

    1. Industry practices

Many event-driven frameworks require users to ensure idempotent operations, such as ENode, RocketMQ, etc...

From an implementation point of view, CAP can do some less stringent idempotence, but strict idempotent cannot.

from cap.

Related Issues (20)

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.