Context:
Let's say i'm building a finance app where the transactions are linked (like blockchain).
In the sense, Transaction 1 has no link, Transaction 2 should have link to transaction 1, Transaction 3 should have link to transaction 2 and so on.
And these links should be specific to accounts. In the sense, Account A will have transaction its own transaction links and Account B will have its own.
Implementation
I want to use a queuing mechanism(Preferably RabbitMQ) to where these transactions are executed one after the other so that we don't need to worry about concurrency issues.
Problems
- Problem with this approach is, if we have a queue for the entire application, then the amount of transactions increase drastically as we increase accounts.
- To solve the first problem we can create queue per accounts so that we can execute these transactions concurrently per account. But problem with this approach is number of queues and consumers will increase. And, since accounts can be created at runtime, Adding listeners dynamically might be a problem (I may be wrong here).
So, I want to know if there are any ways we can solve the problem.
Your help is appreciated.