Forum Discussion
Root bot, skill bot and scaling
- Dec 14, 2022
We had James check his data and found this. See if it helps. In the root bot:
- Double check and be 100% sure that you're using the SkillConversationIdFactory that is a part of the MS chatbot framework (NOT one that you may have created). It should have a IStorage constructor parameter that lets you pass in whatever storage you want to use to persist ids used with skills communication. You probably need to use the class that is given to you in the chatbot framework. (i.e. SkillConversationIdFactory that inherits from"Microsoft.Bot.Builder.Skills.SkillConversationIdFactoryBase")
- For the IStorage object used by SkillConversationIdFactory, If you are using some kind of in-memory only storage, (i.e. A ConcurrentDictionary or other MemoryStorage type object), that might be a problem. The code in SkillConversationIdFactory might not be persisting the conversation/skill ID lookup data (needed to talk with skills) into a place that other apps can read.
I have found some old MS examples that give a "demo" of how to use skills and shows a SkillConversationIdFactory that uses in-memory storage...which of course won't scale or work across different apps.
We initially thought that the deprecated types and the NodeJS bot framework version might play a part in the solution not working. However, we updated all of our dependencies and code to use the latest release and we still could not get the solution to work.
Microsoft says they found no issues on their end. I am hoping if your team can reproduce this problem, it would be an incentive for Microsoft to dig a little deeper.
We had James check his data and found this. See if it helps. In the root bot:
- Double check and be 100% sure that you're using the SkillConversationIdFactory that is a part of the MS chatbot framework (NOT one that you may have created). It should have a IStorage constructor parameter that lets you pass in whatever storage you want to use to persist ids used with skills communication. You probably need to use the class that is given to you in the chatbot framework. (i.e. SkillConversationIdFactory that inherits from"Microsoft.Bot.Builder.Skills.SkillConversationIdFactoryBase")
- For the IStorage object used by SkillConversationIdFactory, If you are using some kind of in-memory only storage, (i.e. A ConcurrentDictionary or other MemoryStorage type object), that might be a problem. The code in SkillConversationIdFactory might not be persisting the conversation/skill ID lookup data (needed to talk with skills) into a place that other apps can read.
I have found some old MS examples that give a "demo" of how to use skills and shows a SkillConversationIdFactory that uses in-memory storage...which of course won't scale or work across different apps.
- voonsionglumJan 03, 2023Brass Contributor
Slacked2737 Thank You for this AWESOME reply. With your suggestion, we made sure to use the SkillConversationIdFactory that is part of the MS chatbot framework and ensured that we have the same non-memory storage passed into it.
Note: we have also switched from our previous CosmosDB Mongo API storage implementation to BlobsStorage. Long story short, with CosmosDB Mongo API, we were getting this.storage.read and this.storage.write errors. This is not related to Microsoft, but related to the DBStorage class we implemented.
We scaled out our root bot to 3 instances and our skill bot to 3 instances. We restarted both bots and ALL skill results are now getting returned successfully!
I can't wait to share this with our Team.
Thank You and Happy New Year!
- padamideDec 14, 2022Copper Contributor
Slacked2737 thanks Stussy!