We would like to use Azure Web PubSub to enable browser clients to exchange messages. Ideally, both clients would get a token from a backend service (e.g. serverless function) that gives them permission to join and send messages to a certain group on PubSub, and clients would send and receives messages to and from this group (using json.webpubsub.azure.v1 subprotocol
).
Our concern is what stops a client from sending an unlimited number of messages, thereby potentially increasing our costs indefinitely (since PubSub charges per message count)? Is there a way to apply rate limiting on an account level basis, so that someone connected from a certain client account can not send more than X messages per minute?
Or is PubSub not meant to be used in use cases from the frontend, but only internally where we control the messages sent?
Thanks!