Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add throttling option to campaigns API? #167

Open
jmensch1 opened this issue Apr 1, 2024 · 5 comments
Open

add throttling option to campaigns API? #167

jmensch1 opened this issue Apr 1, 2024 · 5 comments
Labels
enhancement New feature or request

Comments

@jmensch1
Copy link

jmensch1 commented Apr 1, 2024

Per your docs, the Campaigns api sends messages at a rate of about 60000 per minute. (https://getstream.io/chat/docs/python/campaign_api/?language=python). Would it be possible to add a throttling option so that these messages get sent more slowly, at a rate specified by the user?

The reason is that we have a server that handles the webhooks for new message events. Normally that server handles at most a few hundred events per minute. If that number were to jump to 60000 / minute without any ramp-up time, the server would undoubtedly crash.

@kanat
Copy link
Contributor

kanat commented Apr 1, 2024

Hey @jmensch1,

Thank you for the feedback!

Would disabling webhooks for messages generated by the campaign be a viable option for you in this case?
There are skip_webhook and skip_push params to skip Webhook and Push events accordingly.

cc @vishalnarkhede

@jmensch1
Copy link
Author

jmensch1 commented Apr 2, 2024

Hi @kanat, thanks for getting back to me.

I saw the skip options in the docs. Unfortunately those won't work in our case because we actually want to process the new-message webhooks for a variety of reasons.

Jake

@kanat kanat added the enhancement New feature or request label Apr 3, 2024
@kanat
Copy link
Contributor

kanat commented Apr 3, 2024

Hi @jmensch1,

Thank you for the update!
We will add this to our backlog 👍

@kanat
Copy link
Contributor

kanat commented Apr 4, 2024

Hi @jmensch1,

Would SQS be an option for you in this matter?

@jmensch1
Copy link
Author

jmensch1 commented Apr 4, 2024

Hi @kanat,

I didn't know about that. It's a nice solution and would probably work from a technical point of view. The only problem is that all of our infrastructure is on GCP, and I don't think there would be a lot of interest in opening an account with AWS just for this purpose.

Just so you know, when Stream shut down the first Campaigns api a few months ago, I wrote a service for sending campaigns using the regular Messaging api. It's a bit slow, since I need to stay under the rate limit, but it's working well enough. So it's not urgent for us to use the new Campaigns api right now. I might try it again at some point in the future.

Thanks
Jake

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants