Ejemplo n.º 1
0
 public void Configure(IConfiguration configuration, IClientBuilder clientBuilder)
 {
     clientBuilder.UseAzureStorageClustering(gatewayOptions =>
     {
         gatewayOptions.ConnectionString = TestDefaultConfiguration.DataConnectionString;
     });
 }
Ejemplo n.º 2
0
 private void ConfigureOrleansStorage(IClientBuilder builder)
 {
     builder
     .UseAzureStorageClustering(options =>
     {
         options.TableName        = "clusterstate";
         options.ConnectionString = Environment.GetEnvironmentVariable("AzureWebJobsStorage");
     });
 }
Ejemplo n.º 3
0
        private static IClientBuilder AddOrleansClusterClient(this IClientBuilder builder, OrleansConfig config)
        {
            builder.ConfigureApplicationParts(parts => parts.AddApplicationPart(typeof(IPiSystem).Assembly));

#if DEBUG
            builder.UseLocalhostClustering();
#else
            builder.Configure <ClusterOptions>(options =>
            {
                options.ClusterId = config.ClusterId;
                options.ServiceId = config.ServiceId;
            });

            if (config.DataConnectionString.Contains("6379") || config.DataConnectionString.Contains("6380"))
            {
                builder.UseRedisGatewayListProvider(options => options.ConnectionString = config.DataConnectionString);
            }
            else
            {
                builder.UseAzureStorageClustering(options => options.ConnectionString = config.DataConnectionString);
            }
#endif

            LoggerType loggers = config.GetLoggerTypes();

            if (loggers.HasFlag(LoggerType.AppInsights))
            {
                builder.AddApplicationInsightsTelemetryConsumer(config.InstrumentationKey);
            }

            builder.ConfigureLogging(op =>
            {
                if (loggers.HasFlag(LoggerType.AppInsights))
                {
                    op.AddApplicationInsights(config.InstrumentationKey);
                    op.SetMinimumLevel(Enum.Parse <LogLevel>(config.LogLevel, true));
                }

                if (loggers.HasFlag(LoggerType.Console))
                {
                    op.AddConsole();
                    op.SetMinimumLevel(Enum.Parse <LogLevel>(config.LogLevel, true));
                }

                if (loggers.HasFlag(LoggerType.Debug))
                {
                    op.AddDebug();
                    op.SetMinimumLevel(Enum.Parse <LogLevel>(config.LogLevel, true));
                }
            });

            return(builder);
        }
Ejemplo n.º 4
0
 public void Configure(IConfiguration configuration, IClientBuilder clientBuilder)
 {
     clientBuilder.UseAzureStorageClustering(gatewayOptions =>
     {
         gatewayOptions.ConnectionString = TestDefaultConfiguration.DataConnectionString;
     })
     .AddAzureQueueStreams <AzureQueueDataAdapterV2>(AZURE_QUEUE_STREAM_PROVIDER_NAME,
                                                     options =>
     {
         options.ConnectionString = TestDefaultConfiguration.DataConnectionString;
     })
     .AddSimpleMessageStreamProvider(SMS_STREAM_PROVIDER_NAME);
 }
Ejemplo n.º 5
0
        private IClientBuilder AddStorageProvider(IClientBuilder builder, string connectionString)
        {
            if (string.IsNullOrEmpty(connectionString))
            {
                builder.UseLocalhostClustering();
            }
            else
            {
                if (connectionString.Contains("6379") || connectionString.Contains("6380"))
                {
                    builder.UseRedisGatewayListProvider(options => options.ConnectionString = connectionString);
                }
                else
                {
                    builder.UseAzureStorageClustering(options => options.ConnectionString = connectionString);
                }
            }

            return(builder);
        }
Ejemplo n.º 6
0
 public void Configure(IConfiguration configuration, IClientBuilder clientBuilder)
 {
     clientBuilder.UseAzureStorageClustering(options =>
                                             options.ConfigureTableServiceClient(TestDefaultConfiguration.DataConnectionString));
 }
Ejemplo n.º 7
0
 public void Configure(IConfiguration configuration, IClientBuilder clientBuilder)
 {
     clientBuilder.UseAzureStorageClustering(options => options.ConfigureTestDefaults());
 }