Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static ISiloHost CreateSilo() {
- var builder = new SiloHostBuilder()
- .Configure(options => options.ClusterId = NDGConfig.ClusterId)
- .Configure<ProcessExitHandlingOptions>(options => options.FastKillOnProcessExit = false)
- .ConfigureSiloName(NDGConfig.ClusterId + "-" + NDGConfig.SiloHostName)
- .ConfigureEndpoints(advertisedIP: NDGConfig.SiloIP, siloPort: NDGConfig.SiloPort, gatewayPort: NDGConfig.GatewayPort, listenOnAllHostAddresses: true)
- .ConfigureLogging(b => b.SetMinimumLevel(LogLevel.Error).AddConsole())
- .UseDashboard(options => {
- options.Port = NDGConfig.SiloDashboardPort;
- options.Username = NDGConfig.SiloDashboardUsername;
- options.Password = NDGConfig.SiloDashboardPassword;
- })
- .UseMongoDBReminders(options => {
- options.ConnectionString = NDGConfig.MongoDBConnectionString;
- options.DatabaseName = NDGConfig.ClusterId + "-Reminders";
- })
- .UseMongoDBClustering(options => {
- options.ConnectionString = NDGConfig.MongoDBConnectionString;
- options.DatabaseName = NDGConfig.ClusterId + "-Clustering";
- });
- MongoDBSiloExtensions.AddMongoDBGrainStorageAsDefault(builder, options => {
- options.ConnectionString = NDGConfig.MongoDBConnectionString;
- options.DatabaseName = NDGConfig.ClusterId + "-Storage";
- });
- MongoDBSiloExtensions.AddMongoDBGrainStorage(builder, "PubSubStore", options => {
- options.ConnectionString = NDGConfig.MongoDBConnectionString;
- options.DatabaseName = NDGConfig.ClusterId + "-PubSubStorage";
- });
- return builder.Build();
- }
Add Comment
Please, Sign In to add comment