如何将机器人状态存储在Redis缓存中 [英] How to store bot state in Redis cache

查看:211
本文介绍了如何将机器人状态存储在Redis缓存中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尽管有一些文章描述了如何在Redis缓存中存储bot状态,但是推荐的方法是吗?

Though there are some articles describing how to store bot state in redis cache, is that the recommended approach ?

https://ankitbko.github.io/2016/10/Microsoft-Bot-Framework-Use-Redis-to-store-conversation-state/

我尝试使用依赖注入并使用Redis缓存.尽管该应用程序没有引发任何错误,但是我使用Redis桌面管理器看不到Redis缓存中存储的任何键和值吗?

I tried using Dependency injection and used Redis cache. Though the application does not throw any error, I don't see any key and value stored in Redis cache using my Redis desktop manager?

推荐答案

您可能会更轻松地使用CosmosDB或Table Storage,这是我们为其生产适配器的两个存储系统.

You will probably have an easier time with either CosmosDB or Table Storage, the two storage systems we’ve produced adapters for.

有一个非官方的,用户制作的适配器.可能值得尝试一下: https://github.com/suttna/botbuilder-redis-storage

There is a non-official, user made adapter. It might worth giving it a try: https://github.com/suttna/botbuilder-redis-storage

可以使用Redis,但它不是围绕持久性存储来组织的-是的,您可以将其备份到磁盘上,但是API不适用于爬网.如果您可以自行查找数据,则可以使用这种方法.

It’s possible to use Redis but it’s not organized around durable storage – yes, you can have it backed to disk, but the APIs aren’t great for crawling. It’s the kind of thing you could use if you felt comfortable finding the data on your own.

表存储: https://docs.microsoft.com/zh-CN/bot-framework/dotnet/bot-builder-dotnet-state-azure-table-storage

CosmosDB : https://docs. microsoft.com/en-us/bot-framework/dotnet/bot-builder-dotnet-state-azure-cosmosdb

这篇关于如何将机器人状态存储在Redis缓存中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆