如何创建Actor代理到远程Service Fabric群集 [英] How to create actor proxy to remote Service Fabric cluster

查看:52
本文介绍了如何创建Actor代理到远程Service Fabric群集的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

根据Service Fabric文档( https://azure.microsoft.com/zh-CN/documentation/articles/service-fabric-reliable-actors-introduction/),通过以下方式创建参与者代理:

According to the Service Fabric docs (https://azure.microsoft.com/en-us/documentation/articles/service-fabric-reliable-actors-introduction/), an actor proxy is created this way:

ActorId actorId = ActorId.NewId();

IMyActor myActor = ActorProxy.Create<IMyActor>(actorId, new Uri("fabric:/MyApp/MyActorService"));

await myActor.DoWorkAsync();

好的,这可以正常工作并连接到我的本地集群.但是我不知道如何为远程群集创建代理? (我有一个三节点群集,其IP为10.0.10.10、10.0.11.10、10.0.12.10.)

Ok, this works and connects to my local cluster. But I cannot figure out how to create a proxy to a remote cluster? (I have a three-node cluster with the IPs 10.0.10.10, 10.0.11.10, 10.0.12.10.)

我还尝试使用 ServicePartitionResolver ,在此处进行了说明:

I also tried to use the ServicePartitionResolver, which is explained here: https://azure.microsoft.com/en-us/documentation/articles/service-fabric-reliable-services-communication/, but without success.

推荐答案

ActorProxy和ServiceProxy现在最适合连接到群集中的actor和服务.您可以公开具有-1个实例计数的无状态服务,该实例可以接受用户请求,然后使用Actor和Service远程处理连接到群集中的actor服务.在将来的版本中,我们可能会提供支持远程处理的即用型应用程序网关.

ActorProxy and ServiceProxy today works best for connecting to actors and services within the cluster. You can expose a stateless service with -1 instance count that can accept the user requests and then use Actor and Service remoting to connect to the actor service within the cluster. In the future release we may offer out of the box application gateway that supports remoting.

这篇关于如何创建Actor代理到远程Service Fabric群集的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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