What is the send message throughput of MS Teams bot? - node.js

I am developing an MS Teams app with a bot. Occasionally, the bot needs to send a proactive message to a subset of users who have installed the app.
We cannot send a message to multiple users at once. So we have to make one HTTP request per user per message. Given that batching is not possible and there are API rate limits, I want to know how scalable is this.
Specifically, I want to know the approximate time between when the first and the last user receive the messages if I send message to 5k users at once. What about 10k? 20k?
Any help is much appreciated, thanks :)

This document gives a lot of detail on the throttle limits, and the related time periods required: https://learn.microsoft.com/en-us/microsoftteams/platform/bots/how-to/rate-limit

Related

Venom Bot Pause

I'm developing a chatbot with Venom Bot, and I wanted to know how I can make it stop sending messages when the customer requests assistance with a real person. Would it be possible, for example, to leave it without sending messages within 40 minutes?

Twilio: How to get Programmatical Chat statistics via API?

Question
How can the Twilio API be used to get overall statistics for all channels and messages with given time ranges?
One example of this statistic is: What is the total message count for all channels today?
Bruteforce method (Non-ideal)
Get all channels for a Twilio service. Get all messages for each channel. Check the timestamp of these messages.
The bruteforce method mentioned above is not scalable. Is there a more efficient way this could be done?
Twilio developer evangelist here.
To get that information from the API, you're right you will need to loop through your channels and fetch the messages.
An alternative is to register for the onMessageSent webhook and aggregate the messages in your own database.
Hope this helps.

How to measure Latency of calling a API from Bot framework and time taken to receive the response. i.e. request/response travelling time

I have created a bot for slack and deployed to Azure, I am making some API calls to another server from this BOT, for this bot I have a client requirement, My client wants to measure the time taken by request to reach to server and time taken by response to come back to Bot. (only time taken by request/response to reach to either side . I have been exploring Azure application insight from three days , but could not find any helpful service. I can not change my bot code , Is there any way in azure service by that I can monitor latency?
Here is simple diagram:-
Bot ----t1----> Server
<---t2-----
I don't want response time taken to process at Server side (No calculation time ) Just request/response travelling time.
Ganesh,
What you seem to be asking is how long it takes the API to process a request and return a response. Nothing to do with your bot.
My suggestion would be to create performance tests against the API directly using a tool such as Jmeter. This will give you average response times for say 10,000 requests and plot out on nice graphs etc.
If you need a help doing this, I could write it up for you in step by step instructions.
Let me know.
Thanks,
Tim

Email and SMS queuing in NodeJS

I am developing a node.js app. In my app, I need to send blast emails and SMS to users satisfying a particular criteria. I use Gmail SMTP for emails and a third party vendor for SMS. I'm assuming firing the API's for email and sms services in a loop is dangerous. What's the right way do it?
The time spent is obviously proportional to N, being N the size of your set. As much users you have, longer it takes. Keep in mind that requests over the network are not blocking in any case.
Anyway, unless it risks N to be thousands or millions of items, you can do it in a loop and attach a proper callback to handle responses/errors.
Otherwise, you can send an email/sms and schedule the same operation for the next element using nextTick (see nodejs documentation for further details).
This way you'll spread all the activities over several iterations of the event loop.

Where/how does Skype queue group chat messages when users are offline?

In this SuperUser.com question and elsewhere, I've read that Skype doesn't store your historical chat messages on their servers in a way that's user-accessible. (Of course, what they do for internal archival and analytical purposes is a different story -- as reflected by their privacy policy).
But the user experience for group chats is: when you've been offline and you sign back into Skype... all the messages you missed appear. Even if it's been a while and there are a lot of messages. (I don't know if there are limits on how long or how many.)
So: how is this UX implemented if the messages don't come from Skype servers?
I've read this offhand description which states:
Syncing of group chats ("More than 2 people in a chat") is done by chat sync partners in those chats, and not provided by Skype servers.
If that's correct, I'd love more details about how this works, like:
Has the protocol been specified or reverse-engineered?
Is it available through an API?
Are requests routed through Skype, or is it direcly peer-to-peer?
If peer-to-peer, how are requests authenticated?
My experience is I can only "see" history back to the time when I joined a chat; can a client request or receive messages farther back in the history?
I understand some of of the protocols are currently in flux -- so, bonus points if you can explain whether/how these details are changing.
When you login your client has the last recieved id of that conversation.
Sends it to the other clients. The client who recieves the id looks up all messages after that one, and then sends it back to you.
That way they don't have to store the messages on their servers.

Resources