go-grpc-middleware icon indicating copy to clipboard operation
go-grpc-middleware copied to clipboard

[Feature] [Rate Limit] Add rate limter at client side

Open fangxlmr opened this issue 2 years ago • 4 comments

We already have rate limit interceptor at server side after #134. I'm considering to have one at client side to protect target service if server, since server may have no rate limit at all.

fangxlmr avatar Nov 18 '22 07:11 fangxlmr

I understand where you're coming from, but using an interceptor or not at the client side - will entirely be a decision by the client. So, if a client doesn't choose to add the rate limiter interceptor, the server is not protected anyway! Or, do you suggest enforcing the client to have this interceptor somehow?

rahulkhairwar avatar Mar 18 '23 17:03 rahulkhairwar

Well there is a point in this. If you don't have control over backend, there is no way you can add rate limit there. Thus you might want to rate limit on your side e.g to reduce potential cost.

Fair proposal. Help wanted, we would accept it against v2 branch.

bwplotka avatar Mar 19 '23 00:03 bwplotka

I see.. that makes sense. I can make the changes!

rahulkhairwar avatar Mar 21 '23 15:03 rahulkhairwar

Hi @bwplotka , here's a PR with the changes, against the v2 branch.

Cheers!

rahulkhairwar avatar Mar 22 '23 17:03 rahulkhairwar