如何使用DirectLine App Service Extension重新连接到对话? [英] How to reconnect to conversation using DirectLine App Service Extension?

查看:116
本文介绍了如何使用DirectLine App Service Extension重新连接到对话?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用DirectLine 3.0.3预览版NuGet包通过DirectLine App Service Extension创建一个.NET客户端.我能够使用 directLineClient.StreamingConversations.ConnectAsync(conversationId,receiveMessageCallback)

I am using the DirectLine 3.0.3-preview NuGet package to create a .NET client using DirectLine App Service Extension. I am able to establish a connection and start a new conversation via WebSockets using directLineClient.StreamingConversations.ConnectAsync(conversationId, receiveMessageCallback)

我正在保存从该会话生成的sessionId.但是,当我尝试使用该sessionId创建新连接时,无法重新连接:

I am saving the conversationId generated from that session. However when I try to use that conversationId to create a new connection, I am not able to reconnect:

// Initialize a DirectLineClient using the secret.
var directLineClient = new DirectLineClient(
                           new Uri(_directLineEndpoint),
                           new DirectLineClientCredentials(_directLineSecret));

var conversation =  await directLineClient.Conversations
                             .ReconnectToConversationAsync(savedConversationId);

当我执行上面的代码时,我得到一个空对话对象.当我在使用App Service Extensions之前执行相同的方法时,不会发生这种情况.

When I execute the code above, I get a null conversation object. This does not happen when I do the same approach before I moved to using App Service Extensions.

是否存在使用DirectLine App Service Extension通过WebSockets重新连接到现有对话的新方法?

Is there a new way to reconnect to an existing conversation via WebSockets using DirectLine App Service Extension?

推荐答案

因此,在进一步研究之后,似乎DirectLine App Service Extension不支持消息缓存,如该线程的答案和注释所提及:

So after researching further, it seems that DirectLine App Service Extension does not support message caching, as mentioned by answers and comments from this thread:

Direct Line应用程序扩展-方式和位置邮件已缓存?

这篇关于如何使用DirectLine App Service Extension重新连接到对话?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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