Hi there!
Our publications to MessagingService are getting throttled, but I don’t understand the reason.
In our game, we use MessagingService to send out 1 message to a single topic per 5 seconds per server. The messages are well under 1 Kb.
This worked fine, until we get about 10 servers, and we start getting warnings that the rate of messaging exceeds the limit, please retry after X seconds.
As our number of servers climbs a bit futher to 15-20, publishing breaks down even further and many messages don’t make it through. The warnings are now often accompanied by another warning:
MessagingService:PublishAsync(): Too many publish requests, please try again later.
When I look up MessagingService, it seems to me that our game is staying well within the listed quota limits.
I am sure that each server only publishes once per 5 seconds, so 12 times per server per minute. I thought maybe the receiver scripts would have a hard time at some point, but those are in another place that only listens and doesnt publish any messages (nor does it give any indication of using up any significant resources). The warning (and reason for the messages not coming through) is on the sending servers. The script is fairly simple, a while true loop with publishAsync() and wait(5), I can’t imagine it going wrong and sending too often, and nothing else in our game universe uses PublishAsync().
Could anyone explain to me if I’m doing something wrong, or not understanding the quota mechanics? Or could these throttles be a bug?
Thanks for any advice or help!
Edit: Sorry, I said warnings, but they are probably errors: My PublishAsync call is wrapped in a pcall, so I catch the error and warn() the error message. There is no retry logic.
Edit 2: Posted my code below in a reply, and slightly improved the symptom description in this post.