Exemplo n.º 1
0
        static void Main(string[] args)
        {
            Log.Logger = new LoggerConfiguration()
                         .WriteTo.Console(theme: AnsiConsoleTheme.Code)
                         .CreateLogger();

            var config = ClusterConfiguration.LocalhostPrimarySilo();

            config.AddMemoryStorageProvider();
            config.Defaults.DefaultTraceLevel         = Severity.Warning;
            config.Defaults.TraceFileName             = null;
            config.Defaults.TraceFilePattern          = null;
            config.Defaults.TraceToConsole            = false;
            config.Defaults.StatisticsCollectionLevel = StatisticsLevel.Critical;

            using (var host = new SiloHost("Demo", config))
            {
                host.InitializeOrleansSilo();
                host.StartOrleansSilo();

                Console.WriteLine("Press any key to stop silo...");
                Console.ReadKey(true);

                host.StopOrleansSilo();
            }
        }
 public LocalClusterBuilder()
 {
     _config = ClusterConfiguration.LocalhostPrimarySilo(11111, 30000);
     _config.Defaults.PropagateActivityId = true;
     _config.Globals.RegisterBootstrapProvider <LocalClusterBootstrap>(nameof(LocalClusterBootstrap));
     _builder = new SiloHostBuilder();
 }
Exemplo n.º 3
0
        /// <summary>Build a cluster configuration.</summary>
        /// <param name="baseSiloPort">Base port number to use for silos</param>
        /// <param name="baseGatewayPort">Base port number to use for silo's gateways</param>
        /// <param name="silosCount">The number of initial silos to deploy.</param>
        /// <param name="extendedOptions">The extended fallback options.</param>
        /// <returns>The builded cluster configuration</returns>
        public static ClusterConfiguration BuildClusterConfiguration(int baseSiloPort, int baseGatewayPort, int silosCount, FallbackOptions extendedOptions)
        {
            var config = ClusterConfiguration.LocalhostPrimarySilo(baseSiloPort, baseGatewayPort);

            config.Globals.DeploymentId = CreateDeploymentId(baseSiloPort);
            if (extendedOptions.TraceToConsole.HasValue)
            {
                config.Defaults.TraceToConsole = extendedOptions.TraceToConsole.Value;
            }

            var defaultLogsFolder = extendedOptions.LogsFolder;

            if (!string.IsNullOrWhiteSpace(defaultLogsFolder))
            {
                if (!Directory.Exists(defaultLogsFolder))
                {
                    Directory.CreateDirectory(defaultLogsFolder);
                }

                config.Defaults.TraceFilePattern = $"{defaultLogsFolder}\\{config.Defaults.TraceFilePattern}";
            }

            AddNodeConfiguration(config, Silo.SiloType.Primary, 0, baseSiloPort, baseGatewayPort);
            for (short instanceNumber = 1; instanceNumber < silosCount; instanceNumber++)
            {
                AddNodeConfiguration(config, Silo.SiloType.Secondary, instanceNumber, baseSiloPort, baseGatewayPort);
            }

            config.Globals.ExpectedClusterSize = silosCount;

            config.AdjustForTestEnvironment(extendedOptions.DataConnectionString);
            return(config);
        }
Exemplo n.º 4
0
        static void Main()
        {
            var azureTableCS = "DefaultEndpointsProtocol=https;AccountName=cs44de867d736aax49dfxbd9;AccountKey=I9QAt4VtgU6UTeJNAtxVCjFijmmMiJNjC032iMUJe2CvVkPxaLWnJYb0AfJuR5AtMpUO6LQ3z43EXOcy4Db+hg==";

            var clusterConfig = ClusterConfiguration.LocalhostPrimarySilo();

            clusterConfig.AddMemoryStorageProvider("Default");
            clusterConfig.AddMemoryStorageProvider("PubSubStore");
            clusterConfig.AddSimpleMessageStreamProvider("SMSProvider");

//            clusterConfig.Globals.LivenessType = GlobalConfiguration.LivenessProviderType.AzureTable;
//            clusterConfig.Globals.DataConnectionString = azureTableCS;
//            clusterConfig.Globals.DataConnectionStringForReminders = azureTableCS;
//            clusterConfig.Globals.DeploymentId = "OrleansTest";
//            clusterConfig.Globals.ReminderServiceType = GlobalConfiguration.ReminderServiceProviderType.AzureTable;

            var silo = new SiloHost("Test Silo", clusterConfig);

            silo.InitializeOrleansSilo();
            silo.StartOrleansSilo();

            Console.WriteLine("Press Enter to close.");
            Console.ReadLine();

            silo.ShutdownOrleansSilo();
        }
Exemplo n.º 5
0
        static void Main(string[] args)
        {
            // First, configure and start a local silo
            var siloConfig = ClusterConfiguration.LocalhostPrimarySilo();
            var silo       = new SiloHost("TestSilo", siloConfig);

            silo.InitializeOrleansSilo();
            silo.StartOrleansSilo();

            Console.WriteLine("Silo started.");

            // Then configure and connect a client.
            var clientConfig = ClientConfiguration.LocalhostSilo();
            var client       = new ClientBuilder().UseConfiguration(clientConfig).Build();

            client.Connect().Wait();

            Console.WriteLine("Client connected.");

            //---------------------------------------------------------------------------------------
            // Obtain a grain, invoke message and get result
            //---------------------------------------------------------------------------------------
            var hw = client.GetGrain <IGrainGS>(0);

            Console.WriteLine(hw.HellowWorld().Result);


            Console.WriteLine("\nPress Enter to terminate...");
            Console.ReadLine();

            // Shut down
            client.Close();
            silo.ShutdownOrleansSilo();
        }
Exemplo n.º 6
0
        static void Main(string[] args)
        {
            // First, configure and start a local silo
            var siloConfig = ClusterConfiguration.LocalhostPrimarySilo();
            var silo       = new SiloHost("TestSilo", siloConfig);

            silo.InitializeOrleansSilo();
            silo.StartOrleansSilo();

            Console.WriteLine("Silo started.");

            // Then configure and connect a client.
            var clientConfig = ClientConfiguration.LocalhostSilo();
            var client       = new ClientBuilder().UseConfiguration(clientConfig).Build();

            client.Connect().Wait();

            Console.WriteLine("Client connected.");
            //HERE


            //
            var friend = client.GetGrain <ISayHello>(0);

            Console.WriteLine("\n\n{0}\n\n", friend.SayHelloMessage().Result);

            Console.WriteLine("\nPress Enter to terminate...");
            Console.ReadLine();

            // Shut down
            client.Close();
            silo.ShutdownOrleansSilo();
        }
Exemplo n.º 7
0
        public OrleansFixture()
        {
            var siloPort    = 11111;
            int gatewayPort = 30000;
            var siloAddress = IPAddress.Loopback;

            //siloConfig.Globals.FallbackSerializationProvider = typeof(ILBasedSerializer).GetTypeInfo();
            ClusterConfiguration clusterConfig = ClusterConfiguration.LocalhostPrimarySilo();
            var builder = new SiloHostBuilder();
            var silo    = PreBuild(builder)
                          .Configure(options => options.ClusterId = "TESTCLUSTER")
                          .UseDevelopmentClustering(options => options.PrimarySiloEndpoint = new IPEndPoint(siloAddress, siloPort))
                          .ConfigureEndpoints(siloAddress, siloPort, gatewayPort)
                          //.UseConfiguration(clusterConfig)
                          .ConfigureApplicationParts(pm => pm.AddApplicationPart(typeof(PersistenceTests).Assembly))
                          .Build();

            silo.StartAsync().Wait();
            this.Silo = silo;

            //clientConfig.FallbackSerializationProvider = typeof(ILBasedSerializer).GetTypeInfo();

            ClientConfiguration clientConfig = ClientConfiguration.LocalhostSilo();
            var client = new ClientBuilder()
                         //.UseConfiguration(clientConfig)
                         .ConfigureCluster(c => c.ClusterId = "TESTCLUSTER")
                         .UseStaticClustering(options => options.Gateways = new[] { new IPEndPoint(siloAddress, gatewayPort).ToGatewayUri() })
                         .ConfigureApplicationParts(pm => pm.AddApplicationPart(typeof(PersistenceTests).Assembly))
                         .Build();

            client.Connect().Wait();

            this.Client = client;
        }
Exemplo n.º 8
0
        static void Main(string[] args)
        {
            // First, configure and start a local silo
            var siloConfig = ClusterConfiguration.LocalhostPrimarySilo();
            var silo       = new SiloHost("TestSilo", siloConfig);

            silo.InitializeOrleansSilo();
            silo.StartOrleansSilo();

            Console.WriteLine("Silo started.");

            // Then configure and connect a client.
            var clientConfig = ClientConfiguration.LocalhostSilo();
            var client       = new ClientBuilder().UseConfiguration(clientConfig).Build();

            client.Connect().Wait();

            Console.WriteLine("Client connected.");

            //
            // This is the place for your test code.
            //

            Console.WriteLine("\nPress Enter to terminate...");
            Console.ReadLine();

            // Shut down
            client.Close();
            silo.ShutdownOrleansSilo();
        }
Exemplo n.º 9
0
        private static async Task <ISiloHost> StartSilo()
        {
            var config = ClusterConfiguration.LocalhostPrimarySilo();

            config.AddMemoryStorageProvider();
            var builder = new SiloHostBuilder()
                          .UseConfiguration(config)
                          .ConfigureApplicationParts(parts => parts.AddApplicationPart(typeof(Account).Assembly).WithReferences())
                          .ConfigureServices((context, servicecollection) =>
            {
                servicecollection.AddSingleton <ISerializer, ProtobufSerializer>(); //注册序列化组件
                servicecollection.AddMongoES();                                     //注册MongoDB为事件库
                servicecollection.AddRabbitMQ <MessageInfo>();                      //注册RabbitMq为默认消息队列
            })
                          .Configure <MongoConfig>(c =>
            {
                c.SysStartTime = new DateTime(2018, 2, 1);
                c.Connection   = "mongodb://127.0.0.1:28888";
            })
                          .Configure <RabbitConfig>(c =>
            {
                c.UserName    = "******";
                c.Password    = "******";
                c.Hosts       = new[] { "192.168.199.216:5672" };
                c.MaxPoolSize = 100;
                c.VirtualHost = "/";
            })
                          .ConfigureLogging(logging => logging.AddConsole());

            var host = builder.Build();
            await host.StartAsync();

            return(host);
        }
Exemplo n.º 10
0
 private async Task Start()
 {
     siloConfig = ClusterConfiguration.LocalhostPrimarySilo();
     silo       = new SiloHost("Test Silo", siloConfig);
     silo.InitializeSilo();
     await silo.StartSiloAsync();
 }
        protected void Application_Start()
        {
            // NOTE: I don't know WHY Orleans doesn't work if I don't do this...
            // But this "helps" get Orleans to find the grains.
            var x = typeof(UserGrain);

            AreaRegistration.RegisterAllAreas();
            SWH.GlobalConfiguration.Configure(WebApiConfig.Register);
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);

            // Note: Need Orleans 1.5.0 or higher to do this...
            var configuration = ClusterConfiguration.LocalhostPrimarySilo(11111, 30000);

            configuration.UseStartupType <Startup>();
            configuration.Globals.RegisterStorageProvider <MemoryStorage>("Default");

            this.siloHost = new SiloHost("KeyWatcherSilo", configuration);
            this.siloHost.InitializeOrleansSilo();

            if (!this.siloHost.StartOrleansSilo())
            {
                throw new SystemException($"Failed to start Orleans silo '{this.siloHost.Name}'");
            }

            WebApiApplication.InitializeGrainClient();
        }
Exemplo n.º 12
0
            protected override ISiloHostBuilder PreBuild(ISiloHostBuilder builder)
            {
                var siloConfig = ClusterConfiguration.LocalhostPrimarySilo();

                siloConfig.Globals.ReminderServiceType   = GlobalConfiguration.ReminderServiceProviderType.Custom;
                siloConfig.Globals.ReminderTableAssembly = "Orleans.Reminders.CosmosDB";
                siloConfig.AddAzureCosmosDBReminders();
                siloConfig.AddAzureCosmosDBPersistence(TEST_STORAGE);
                return(builder.UseConfiguration(siloConfig)
                       .UseAzureCosmosDBPersistence(opt =>
                {
                    opt.AccountEndpoint = ACC_ENDPOINT;
                    opt.AccountKey = ACC_KEY;
                    opt.ConnectionMode = Microsoft.Azure.Documents.Client.ConnectionMode.Gateway;
                    opt.ConnectionProtocol = Microsoft.Azure.Documents.Client.Protocol.Https;
                    opt.AutoUpdateStoredProcedures = true;
                })
                       .UseAzureCosmosDBReminders(opt =>
                {
                    opt.AccountEndpoint = ACC_ENDPOINT;
                    opt.AccountKey = ACC_KEY;
                    opt.ConnectionMode = Microsoft.Azure.Documents.Client.ConnectionMode.Gateway;
                    opt.ConnectionProtocol = Microsoft.Azure.Documents.Client.Protocol.Https;
                    opt.DropDatabaseOnInit = true;
                    opt.AutoUpdateStoredProcedures = true;
                }));
            }
Exemplo n.º 13
0
        private static async Task <ISiloHost> StartSilo()
        {
            // define the cluster configuration
            var config = ClusterConfiguration.LocalhostPrimarySilo();

            config.AddMemoryStorageProvider();
            // use this for Serilog

            /* Log.Logger = new LoggerConfiguration()
             *   .Enrich.FromLogContext()
             *   .WriteTo.Console()
             *   .CreateLogger();
             */

            var builder = new SiloHostBuilder()
                          .UseConfiguration(config)
                          .ConfigureApplicationParts(parts => parts.AddFromApplicationBaseDirectory())
                          .ConfigureLogging(logging => logging.AddConsole());
            //.AddSerilog(Log.Logger, dispose: true));

            var host = builder.Build();
            await host.StartAsync();

            return(host);
        }
Exemplo n.º 14
0
        /// <summary>
        /// Configures a localhost silo.
        /// </summary>
        /// <param name="builder">The host builder.</param>
        /// <param name="siloPort">The silo-to-silo communication port.</param>
        /// <param name="gatewayPort">The client-to-silo communication port.</param>
        /// <returns>The silo builder.</returns>
        public static ISiloHostBuilder ConfigureLocalHostPrimarySilo(this ISiloHostBuilder builder, int siloPort = 22222, int gatewayPort = 40000)
        {
            string siloName = Silo.PrimarySiloName;

            builder.Configure <SiloOptions>(options => options.SiloName = siloName);
            return(builder.UseConfiguration(ClusterConfiguration.LocalhostPrimarySilo(siloPort, gatewayPort)));
        }
Exemplo n.º 15
0
        public ClusterConfiguration BuildClusterConfiguration(int baseSiloPort, int baseGatewayPort, int silosCount)
        {
            var config = ClusterConfiguration.LocalhostPrimarySilo(baseSiloPort, baseGatewayPort);

            config.Globals.DeploymentId    = CreateDeploymentId();
            config.Defaults.TraceToConsole = DefaultTraceToConsole;
            if (!string.IsNullOrWhiteSpace(DefaultLogsFolder))
            {
                if (!Directory.Exists(DefaultLogsFolder))
                {
                    Directory.CreateDirectory(DefaultLogsFolder);
                }

                config.Defaults.TraceFilePattern = $"{DefaultLogsFolder}\\{config.Defaults.TraceFilePattern}";
            }

            AddNodeConfiguration(config, Silo.SiloType.Primary, 0, baseSiloPort, baseGatewayPort);
            for (short instanceNumber = 1; instanceNumber < silosCount; instanceNumber++)
            {
                AddNodeConfiguration(config, Silo.SiloType.Secondary, instanceNumber, baseSiloPort, baseGatewayPort);
            }

            config.Globals.ExpectedClusterSize = silosCount;

            config.AdjustForTestEnvironment();
            return(config);
        }
        /// <summary>
        /// start primary
        /// </summary>
        public OrleansHostWrapper()
        {
            var config = ClusterConfiguration.LocalhostPrimarySilo();

            config.Defaults.TraceToConsole = true;
            //config.Defaults.DefaultTraceLevel = Orleans.Runtime.Severity.Warning;
            siloHost = new SiloHost("primary", config);
        }
Exemplo n.º 17
0
        private static int StartSilo(string[] args)
        {
            // define the cluster configuration
            var config = ClusterConfiguration.LocalhostPrimarySilo();

            hostWrapper = new OrleansWrapper(config, args);
            return(hostWrapper.Run());
        }
Exemplo n.º 18
0
        private static int StartSilo(string[] args)
        {
            // define the cluster configuration
            var config = ClusterConfiguration.LocalhostPrimarySilo(siloPort: 11111, gatewayPort: 30000);

            config.AddMemoryStorageProvider();

            _hostWrapper = new OrleansHostWrapper(config, args);
            return(_hostWrapper.Run());
        }
Exemplo n.º 19
0
        private static async Task <Orleans.Runtime.Host.SiloHost> StartSilo()
        {
            // define the cluster configuration
            var siloConfig = ClusterConfiguration.LocalhostPrimarySilo();
            var silo       = new Orleans.Runtime.Host.SiloHost("Test Silo", siloConfig);

            silo.InitializeOrleansSilo();
            silo.StartOrleansSilo();
            return(silo);
        }
Exemplo n.º 20
0
        private static int StartSilo(string[] args)
        {
            // define the cluster configuration
            var config = ClusterConfiguration.LocalhostPrimarySilo(26223, 26224);

            config.AddMemoryStorageProvider();

            hostWrapper = new OrleansHostWrapper(config, args);
            return(hostWrapper.Run());
        }
Exemplo n.º 21
0
        private static int StartSilo(string[] args)
        {
            // 用于测试目的的本机集群配置信息
            var config = ClusterConfiguration.LocalhostPrimarySilo();

            config.AddMemoryStorageProvider();

            hostWrapper = new OrleansHostWrapper(config, args);
            return(hostWrapper.Run());
        }
Exemplo n.º 22
0
        private static int StartSilo(string[] args)
        {
            var config = ClusterConfiguration.LocalhostPrimarySilo();

            config.AddMemoryStorageProvider();

            //config.Defaults.DefaultTraceLevel = Severity.Verbose3;

            _hostWrapper = new OrleansHostWrapper(config, args);
            return(_hostWrapper.Run());
        }
Exemplo n.º 23
0
        public MessageSerializerTests(ITestOutputHelper output)
        {
            this.output = output;
            MessagingStatisticsGroup.Init(false);

            var orleansConfig = ClusterConfiguration.LocalhostPrimarySilo();

            BufferPool.InitGlobalBufferPool(orleansConfig.Globals);

            SerializationManager.InitializeForTesting();
        }
Exemplo n.º 24
0
        private static int StartSilo(string[] args)
        {
            var config = ClusterConfiguration.LocalhostPrimarySilo();

            config.AddMemoryStorageProvider();
            config.AddAzureTableStorageProvider(connectionString: "UseDevelopmentStorage=true");
            //config.Defaults.DefaultTraceLevel = Severity.Verbose3;

            hostWrapper = new OrleansHostWrapper(config, args);
            return(hostWrapper.Run());
        }
Exemplo n.º 25
0
        private static int StartSilo(string[] args)
        {
            // define the cluster configuration
            var config = ClusterConfiguration.LocalhostPrimarySilo();

            config.AddMemoryStorageProvider();
            config.UseStartupType <OrleansStartup>();
            // config.Defaults.DefaultTraceLevel = Orleans.Runtime.Severity.Verbose3;
            hostWrapper = new OrleansHostWrapper(config, args);

            return(hostWrapper.Run());
        }
        public static void Main(string[] args)
        {
            CreateWebHostBuilder(args).Build().Run();

            // First, configure and start a local silo
            var siloConfig = ClusterConfiguration.LocalhostPrimarySilo();
            var silo       = new SiloHost("TestSilo", siloConfig);

            silo.InitializeOrleansSilo();
            silo.StartOrleansSilo();

            Console.WriteLine("Silo started.");

            // Then configure and connect a client.
            var clientConfig = ClientConfiguration.LocalhostSilo();
            var client       = new ClientBuilder().UseConfiguration(clientConfig).Build();

            client.Connect().Wait();

            Console.WriteLine("Client connected.");

            //
            var saludo    = client.GetGrain <MergeInterface.IMergeSort>(Guid.NewGuid());
            var resultado = ReadFileYeah(@"C: \Users\Chino Guzman\source\repos\DistributedMergeSort\oraciones.txt").ToList();

            /*var valores = decoder(resultado);
             * var resultadofinal = MergeSort(saludo, 0, valores, 1, valores.Count);
             * foreach(List<int> x in resultadofinal)
             * {
             *  Console.WriteLine(x[0]);
             * }
             * var valoresfinales = encoder(resultadofinal);
             * foreach (char[] x in valoresfinales) {
             *  foreach (char hola in x) {
             *      Console.Write(hola);
             *  }
             *  Console.WriteLine("");
             * }*/

            var yeah = MergeSort(saludo, resultado, 1, resultado.Count);

            foreach (string x in yeah)
            {
                Console.WriteLine(x);
            }

            Console.WriteLine("\nPress Enter to terminate...");
            Console.ReadLine();

            // Shut down
            client.Close();
            silo.ShutdownOrleansSilo();
        }
Exemplo n.º 27
0
        // https://medium.com/@scott.rangeley/from-the-ground-up-basics-of-porting-to-orleans-2-0-beta-af6824990d77
        private static ISiloHost BuildSilo()
        {
            var localConfiguration = ClusterConfiguration.LocalhostPrimarySilo();

            example.RegisterProvider(localConfiguration);

            return(new SiloHostBuilder()
                   .UseConfiguration(localConfiguration)
                   .ConfigureLogging(logging => logging.AddConsole())
                   .AddApplicationPartsFromReferences(typeof(MeterGrain).Assembly)
                   .Build());
        }
Exemplo n.º 28
0
        private static void InitSilo(string[] args)
        {
            var siloConfig = ClusterConfiguration.LocalhostPrimarySilo();

            siloHost = new SiloHost(System.Net.Dns.GetHostName(), siloConfig);
            siloHost.InitializeOrleansSilo();
            var startedok = siloHost.StartOrleansSilo();

            if (!startedok)
            {
                throw new SystemException($"Failed to start Orleans silo '{siloHost.Name}' as a {siloHost.Type} node");
            }
        }
Exemplo n.º 29
0
        private static void StartSilo()
        {
            var config = new SiloHost(Dns.GetHostName(), new FileInfo("OrleansConfiguration.xml"));

            if (Environment.GetEnvironmentVariable("LAUCHING_ENV") == "LOCALHOST")
            {
                config.Config = ClusterConfiguration.LocalhostPrimarySilo();
                config.Config.AddMemoryStorageProvider("RedisStore");
            }
            else
            {
                config.Config.Globals.MembershipTableAssembly = typeof(Orleans.ConsulUtils.LegacyConsulGatewayListProviderConfigurator).Assembly.FullName;
                var consulIps = Dns.GetHostAddressesAsync("consul").Result;
                config.Config.Globals.DataConnectionString = $"http://{consulIps.First()}:8500";
                config.Config.Globals.LivenessType         = GlobalConfiguration.LivenessProviderType.Custom;

                var ips = Dns.GetHostAddressesAsync(Dns.GetHostName()).Result;
                config.Config.Defaults.HostNameOrIPAddress = ips.FirstOrDefault()?.ToString();

                config.Config.Globals.RegisterStorageProvider <Orleans.StorageProviders.RedisStorage.RedisStorage>(
                    "RedisStore", new Dictionary <string, string>()
                {
                    { "RedisConnectionString", "storage" },
                    { "UseJsonFormat", "false" }
                });
            }


            config.Config.Globals.ClusterId           = "DDBMSP-Cluster";
            config.Config.Globals.ReminderServiceType = GlobalConfiguration.ReminderServiceProviderType.Disabled;
            config.Config.Globals.SerializationProviders.Add(typeof(ProtobufSerializer).GetTypeInfo());
            config.Config.RegisterDashboard();

            var builder = SiloHostBuilder.CreateDefault().UseConfiguration(config.Config);

            builder.GetApplicationPartManager()
            .AddApplicationPart(typeof(Common.CSharpRepl.Context).Assembly)
            .AddApplicationPart(typeof(ArticleState).Assembly)
            .AddFromApplicationBaseDirectory()
            .AddApplicationPart(typeof(Interfaces.Grains.Aggregators.IAggregator <>).Assembly);

            SiloHost = builder.ConfigureSiloName(Dns.GetHostName())
                       .UseDashboard(options => {
                options.HostSelf = true;
                options.Port     = 8080;
                options.Host     = "*";
            })
                       .Build();

            SiloHost.StartAsync();
        }
Exemplo n.º 30
0
        static void Main(string[] args)
        {
            // First, configure and start a local silo
            var siloConfig = ClusterConfiguration.LocalhostPrimarySilo();

            siloConfig.AddSimpleMessageStreamProvider(Common.Constants.InboundTransmissionStreamProvider);
            siloConfig.AddSimpleMessageStreamProvider(Common.Constants.OutboundTransmissionStreamProvider);
            var silo = new SiloHost("TestSilo", siloConfig);

            silo.Config.AddMemoryStorageProvider("PubSubStore");
            silo.InitializeOrleansSilo();
            silo.StartOrleansSilo();

            Console.WriteLine("Silo started.");

            // Then configure and connect a client.
            var clientConfig = ClientConfiguration.LocalhostSilo();

            clientConfig.AddSimpleMessageStreamProvider(Common.Constants.InboundTransmissionStreamProvider);
            clientConfig.AddSimpleMessageStreamProvider(Common.Constants.OutboundTransmissionStreamProvider);
            var client = new ClientBuilder().UseConfiguration(clientConfig).Build();

            client.Connect().Wait();

            Console.WriteLine("Client connected.");

            //
            // This is the place for your test code.
            //
            var transport = new Transport();

            var inboundSubscription = transport.Received
                                      .Subscribe(datagram => client.InboundTransmissionStream(datagram.IpAddress).OnNextAsync(datagram));

            var outboundSubscription = client.OutboundTransmissionStream()
                                       .SubscribeAsync((datagram, token) => transport.Send(datagram))
                                       .Result;

            var connection = transport.Connect();

            Console.WriteLine("\nPress Enter to terminate...");
            Console.ReadLine();
            Console.WriteLine("\nTerminating...");

            inboundSubscription.Dispose();
            outboundSubscription.UnsubscribeAsync().Wait();

            // Shut down
            client.Close();
            silo.ShutdownOrleansSilo();
        }