I am using graph sdk for integrating to Teams.
I had a couple of questions with regards to throttling and chat creation
1) I see there is in built throttling handling per your docs for graph sdk and I am using the sdk and the default retry handler.
There doesn't seem to be much info about throttling for POST /chats/{chat-id}/messages, but I do see POST /chats/{chat-id}/sendActivityNotification is 20 rps Assuming this is same, I am getting throttled and my retries are failing when I even try 2 chats per second.
https://docs.microsoft.com/en-us/graph/throttling#microsoft-teams-service-limits
This below error is what I got when I removed the default retry handler.
Code: TooManyRequests
Message: UnknownError
Inner error:
AdditionalData:
date: 2022-04-15T15:00:34
request-id: 7d95abb9-9260-4a68-8f77-3e62632638b2
client-request-id: 7d95abb9-9260-4a68-8f77-3e62632638b2
ClientRequestId: 7d95abb9-9260-4a68-8f77-3e62632638b2
With Retry handler it fails with Service Exception occurred while sending direct IM. Details: Code: tooManyRetries
Message: More than 1 retries encountered while sending the request.
Is there a specific limit I should keep to for this from not happening? I think 2 ims per second is an okay limit. I am not sure what I may be doing wrong.
2)For single chats, should there be reuse of chati ds? There is no guidance in weather or not creating a new chat Id when trying to send an IM is a bad practise. If I wanted to send an IM to a person 10 times, should I do that with same chat id? Is there a benefit in using a single chat Id for these 10 IMS. Or rather it doesn't matter if there are 10 new chats created? Could you add guidance on this in your documentation as well?