Search code examples
websocketbotframeworkpollingazure-bot-servicedirect-line-botframework

HTTP GET polling or Websocket connection for multiple active conversations in Direct Line BOT


I am using directline to integrate the bot with different channel or aggregator like MessageBird, WeChat Line etc. My BOT can send multiple messages as a response. There can be 1000+ unique user who can send and receive messages through Direct Line Bot. As per the document, I am able to send these messages to direct line bot after starting the conversation.

I have created a middle layer service which is a connector between channels/aggregators like Line, Message Bird etc. and the direct line bot. We are planning to use websocket interface to receive messages from the directline bot. I have went through the documentation and I have following questions:

  1. Do we need to create a websocket or HTTP GET polling for each active conversation to receive messages from direct line bot?
  2. If yes, How can we scale these websockets or polling service if there are numerous active ongoing conversations say 1000+?

I have seen similar post here but I don't have option not to use Direct Line to connect the Bot and channels/aggregators.

Please let me know if you need additional information. Thanks for your help!


Solution

  • The answers to your questions are as follows:

    1. YES, you do need to create a websocket or a HTTP GET polling for each active conversation to receive messages from a direct line bot. The websocket or HTTP GET for activities is specific to 1 conversation and typically it's 1 conversion to 1 user.

    2. You do not need to scale this on the channel side. Our service will easily handle that load (for thousands of concurrent bots).However, you will need to scale your client appropriately, which is basically building a scalable web service.

    ​ Hope this helps.