sava-software / sava

Solana Java SDK
MIT License
4 stars 0 forks source link

RPC client rate limiting #5

Closed imaykay closed 1 week ago

imaykay commented 1 week ago

Hi there,

I might describe my general first steps with your framework in another issue to give some context. But this point seem to be generally important: Is there a way to throttle rpc calls yet? And if not do you want to add it to the framework or should every user take care of it on his own? I got e.g. software.sava.rpc.json.http.response.JsonRpcException: Too many requests for a specific RPC call during usage.

I worked before in a completely unrelated project with resilience4j which was okay. I had the feeling that it is not a 100% accurate as I saw rate limit exceptions from time to time but this could ofc also come from bugs on the server. Depending on the rate limiting algorithm on the serverside I also heard of bucket4j. And there will be others ofc. Just for some reference.

Cheers!

jpe7s commented 1 week ago

Managing request-capacity, rate-limiting, and back-offs is outside the scope of these libraries and should be managed by service/application/framework code.

I do have some service level constructs that I use such as these Call, CapacityState and ErrorHandler classes in my back-end services, such as this Address Lookup Table Discovery Service. However, if I ever decide to try turn that into an official project and support it is probably a year out, so I wouldn't depend on it.