GithubHelp home page GithubHelp logo

If there have multiple instances of ProcessOutBoxJob, The events may be processed in many times. about sample-dotnet-core-cqrs-api HOT 3 CLOSED

kgrzybek avatar kgrzybek commented on May 16, 2024
If there have multiple instances of ProcessOutBoxJob, The events may be processed in many times.

from sample-dotnet-core-cqrs-api.

Comments (3)

kgrzybek avatar kgrzybek commented on May 16, 2024

Hi @zh6335901,

If you have many Outbox processors you can't process events in parallel because the order of events matters. It will be a problem for your subscriber if he would receive OrderCanceled event and then OrderCrated event.

Even you will solve the problem with processing one event many times using some locking mechanism on the table or more advanced solution like using Rabbit MQ which has "round-robin" by default, the order of published events would be incorrect.

So you should have only one processing instance working at the same time. If you want to have multiple instances, other instances should be inactive. You can achieve this using Single Consumer Rabbit MQ feature: https://www.rabbitmq.com/consumers.html#single-active-consumer As documentation says:

Consuming with only one consumer is useful when messages must be consumed and processed in the same order they arrive in the queue.

from sample-dotnet-core-cqrs-api.

zh6335901 avatar zh6335901 commented on May 16, 2024

Hi @kgrzybek
You are right. The order of events is important. But if the Outbox processors only have one instance, I am worried about it would be lost the high available.
Maybe i need find a solution that multiple instances but only one working at the same time.

from sample-dotnet-core-cqrs-api.

zh6335901 avatar zh6335901 commented on May 16, 2024

Thank you for your answer. And your aritcles is help me out

from sample-dotnet-core-cqrs-api.

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.