尝试使用 Consul 设置 Orleans Cluster 成员资格

Trying to set up Orleans Cluster membership with Consul

我正在尝试使用现有的 Consul 集群作为测试 Orleans 应用程序的成员提供者。

我在将我的客户端应用程序连接到 Silo 时收到此错误

Could not find any gateway in Orleans.Runtime.Host.ConsulBasedMembershipTable. Orleans client cannot initialize.

深入了解 ConsulUtils class,正在检索的条目没有定义 ProxyPort - 并被丢弃 - 因此结果集为空。

我这样初始化筒仓:

        var clusterConfiguration = new ClusterConfiguration();
        clusterConfiguration.Globals.DataConnectionString = "http://localhost:8500";
        clusterConfiguration.Globals.DeploymentId = "OrleansPlayground";
        clusterConfiguration.Globals.LivenessType = GlobalConfiguration.LivenessProviderType.Custom;
        clusterConfiguration.Globals.MembershipTableAssembly = "OrleansConsulUtils";
        clusterConfiguration.Globals.ReminderServiceType = GlobalConfiguration.ReminderServiceProviderType.Disabled;

        var silohost = new SiloHost("Fred", clusterConfiguration);

        silohost.InitializeOrleansSilo();
        startup = Task.Factory.StartNew(() =>
        {
            return silohost.StartOrleansSilo();
        });
        return true;

我这样设置我的客户端应用程序:

        var config = new ClientConfiguration();

        config.CustomGatewayProviderAssemblyName = "OrleansConsulUtils";
        config.DataConnectionString = "http://localhost:8500"; 
        config.DeploymentId = "OrleansPlayground";
        config.GatewayProvider = ClientConfiguration.GatewayProviderType.Custom;

        GrainClient.Initialize(config);

查看 ConsulUtils 中的代码,我可以看到保存条目时未设置 ProxyPort(即为 0)。所以我假设我在初始化筒仓时遇到了问题 - 但我不知道它是什么!

如果不深入挖掘,听起来确实像是一个错误。请在 GitHub 上转发,我们会尽力帮助您。