Giter VIP home page Giter VIP logo

Comments (3)

juks avatar juks commented on June 19, 2024

Hi Victor!

The queue approach is the result of mPOS startups reality: you have a merchant ID together with one of few terminal IDs (TID). But your customers might have more points of sale, more messengers. Even if you ask your bank for more — it might be not always possible to get. Only one message with the same TID can be processed by payment systems at a time. So, in case there are two messages with one TID — they will get queued.

Basically you right: 10 requests, made by one terminal will take up to 10 * timeout seconds to complete. In case there will be messages with different TIDs, they will be passed to the upstream one by one immediately, then responses will get dispatched in order and at the time of appearance.

You may see this in action by running:

nodejs socketQueue.js --upstreamHost=localhost --upstreamPort=5000 --listenPort=2014 --vv --echoServerPort=5000 --testTargetHost=localhost --testTargetPort=2014 --testClients=100

from iso-8583-socket-queue.

VictorDusautois avatar VictorDusautois commented on June 19, 2024

Hi,

That really makes sense. Even from an ATM terminal only one transaction can be carried out at a time. And if the TID is different as you said it will be executed concurrently then there is no issue.

Just being curious, could you point to the files which is validating TID for queuing purpose? If i want to test concurrency from same terminal (TID), will it be much difficult to change the code and remove TID validation for Queueing? If you could just guide on which files it's validating I could give it a try from my end.

from iso-8583-socket-queue.

juks avatar juks commented on June 19, 2024

Victor, there is queueLockTerminal parameter that does the job.

For the sake of curiosity, please see here: https://github.com/juks/SocketQueue/blob/2f7b6519fce1c615be84ffdd672dae8cdbb35878/lib/iso8583-queue/lib/iso8583Queue.js#L132

from iso-8583-socket-queue.

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.