相关疑难解决方法(0)

服务结构服务远程处理

在过去的几周里,我一直在从云服务迁移到Service Fabric,并且使用两个服务之间的Remoting遇到了一些绊脚石.

我一直在使用Service Remoting上的官方文档和示例代码,特别是我试图让这里概述的示例工作:

https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-reliable-services-communication-remoting

我有2项服务.一个名为"RemoteService",另一个名为"CallerService".两者都源自默认的无状态服务项目.

"RemoteService""CallerService"项目中,我添加了以下接口来描述它们之间的服务契约:

public interface IMyService : IService
{
    Task<string> HelloNameAsync(string name);
}
Run Code Online (Sandbox Code Playgroud)

"RemoteService"中,我在RemoteService类中创建了asociated方法

public Task<string> HelloNameAsync(string name)
{
    return Task.FromResult("Hello " + name + "!");
}
Run Code Online (Sandbox Code Playgroud)

我还使用以下内容覆盖CreateServiceInstanceListeners

protected override IEnumerable<ServiceInstanceListener> CreateServiceInstanceListeners()
{
    return new[] { new ServiceInstanceListener(context => this.CreateServiceRemotingListener(context)) };
}
Run Code Online (Sandbox Code Playgroud)

在我的"CallerService"中,当我尝试连接时,使用以下内容调用"RemoteService":

IMyService helloNameClient = ServiceProxy.Create<IMyService>(new Uri("fabric:/Application/RemoteService"));
string message = await helloNameClient.HelloNameAsync("Luke");
Run Code Online (Sandbox Code Playgroud)

我得到了这个例外

InnerException = {"Interface id '1994370306' is not implemented by …
Run Code Online (Sandbox Code Playgroud)

c# azure azure-service-fabric

3
推荐指数
1
解决办法
3282
查看次数

从群集中的其他应用程序调用服务

是否可以在Service Fabric Cluster中将服务或参与者从一个应用程序调用到另一个应用程序?当我尝试(使用正确的Uri使用ActorProxy.Create)时,我得到了"没有为界面找到MethodDispatcher"

azure-service-fabric

2
推荐指数
1
解决办法
1182
查看次数

标签 统计

azure-service-fabric ×2

azure ×1

c# ×1