I am using Hyperledger sawtooth, in which I am storing transactions and simultaneously I am reading transactions as well.
But at some points of time I am getting error of "Request failed with status code 429" and some batches are rejected.
Is anyone faced similar issues? Do you find any alternate solution for it?
Let's understand the problem you are facing (the what/why/how part):
Hyperledger Sawtooth rejects the client requests with the code 429 if it finds that there are too many requests. The validator maintains the statistics of how many blocks are being produced, how many transactions are flowing in to it and predicts how many transactions it can process in a given internal. In other terms if you start receiving the error code 429, it indicates that your validator thinks it has enough transactions to process. This would save the validator from overwhelming requests.
Possible solutions: (these are just a couple of pointers out of many possibilities)
Limit the client transaction rate: Proxy the client requests, put a retry mechanism to send the transactions to the validator. If your proxy layer finds that the validator is full, let it cache the requests coming in from the client.
Disable backpressure handler from the validator. I am not aware of any flag for it. I have seen people doing it and figuring out that it is not a good idea.
Hope you find a solution that works best for you, happy to learn what solution worked for you