当前位置: 首页>>代码示例>>C#>>正文


C# EndpointConfiguration.UseDataBus方法代码示例

本文整理汇总了C#中EndpointConfiguration.UseDataBus方法的典型用法代码示例。如果您正苦于以下问题:C# EndpointConfiguration.UseDataBus方法的具体用法?C# EndpointConfiguration.UseDataBus怎么用?C# EndpointConfiguration.UseDataBus使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在EndpointConfiguration的用法示例。


在下文中一共展示了EndpointConfiguration.UseDataBus方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Complex

        void Complex(EndpointConfiguration endpointConfiguration)
        {
            string azureStorageConnectionString = "";
            string basePathWithinContainer = "";
            string containerName = "";
            int blockSize = 10;
            int timeToLiveInSeconds = 1;
            int maxNumberOfRetryAttempts = 3;
            int numberOfIoThreads = 3; // number of parallel operations that may proceed.
            // number of blocks that may be simultaneously uploaded when uploading a blob that is greater than the value specified by the
            int backOffIntervalBetweenRetriesInSecs = 1000;

            #region AzureDataBusSetup

            DataBusExtentions<AzureDataBus> dataBus = endpointConfiguration.UseDataBus<AzureDataBus>();
            dataBus.ConnectionString(azureStorageConnectionString);
            dataBus.Container(containerName);
            dataBus.BasePath(basePathWithinContainer);
            dataBus.BlockSize(blockSize);
            dataBus.DefaultTTL(timeToLiveInSeconds);
            dataBus.MaxRetries(maxNumberOfRetryAttempts);
            dataBus.NumberOfIOThreads(numberOfIoThreads);
            dataBus.BackOffInterval(backOffIntervalBetweenRetriesInSecs);

            #endregion

        }
开发者ID:odelljl,项目名称:docs.particular.net,代码行数:27,代码来源:Usage.cs

示例2: Usage

        Usage(EndpointConfiguration endpointConfiguration)
        {
            #region AzureDataBus
            endpointConfiguration.UseDataBus<AzureDataBus>();

            #endregion
        }
开发者ID:odelljl,项目名称:docs.particular.net,代码行数:7,代码来源:Usage.cs

示例3: AsyncMain

    static async Task AsyncMain()
    {
        Console.Title = "Samples.AzureBlobStorageDataBus.Sender";
        EndpointConfiguration endpointConfiguration = new EndpointConfiguration("Samples.AzureBlobStorageDataBus.Sender");
        endpointConfiguration.UseSerialization<JsonSerializer>();

        #region ConfiguringDataBusLocation

        endpointConfiguration.UseDataBus<AzureDataBus>()
            .ConnectionString("UseDevelopmentStorage=true");

        #endregion

        endpointConfiguration.UsePersistence<InMemoryPersistence>();
        endpointConfiguration.EnableInstallers();
        endpointConfiguration.SendFailedMessagesTo("error");

        IEndpointInstance endpoint = await Endpoint.Start(endpointConfiguration);
        try
        {
            await Run(endpoint);
        }
        finally
        {
            await endpoint.Stop();
        }
    }
开发者ID:odelljl,项目名称:docs.particular.net,代码行数:27,代码来源:Program.cs

示例4: Usage

        Usage(EndpointConfiguration endpointConfiguration)
        {
            #region PluginCustomDataBus
            endpointConfiguration.UseDataBus(typeof(CustomDataBus));

            #endregion
        }
开发者ID:odelljl,项目名称:docs.particular.net,代码行数:7,代码来源:Usage.cs

示例5: AsyncMain

    static async Task AsyncMain()
    {
        Console.Title = "Samples.Unobtrusive.Client";
        var endpointConfiguration = new EndpointConfiguration("Samples.Unobtrusive.Client");
        endpointConfiguration.EnableInstallers();
        endpointConfiguration.UsePersistence<InMemoryPersistence>();
        endpointConfiguration.UseDataBus<FileShareDataBus>()
            .BasePath(@"..\..\..\DataBusShare\");
        byte[] encryptionKey = Encoding.ASCII.GetBytes("gdDbqRpqdRbTs3mhdZh9qCaDaxJXl+e6");
        endpointConfiguration.RijndaelEncryptionService("2015-10", encryptionKey);
        endpointConfiguration.SendFailedMessagesTo("error");

        endpointConfiguration.ApplyCustomConventions();

        var endpointInstance = await Endpoint.Start(endpointConfiguration)
            .ConfigureAwait(false);
        try
        {
            await CommandSender.Start(endpointInstance)
                .ConfigureAwait(false);
        }
        finally
        {
            await endpointInstance.Stop()
                .ConfigureAwait(false);
        }
    }
开发者ID:chriscatilo,项目名称:docs.particular.net,代码行数:27,代码来源:Program.cs

示例6: Usage

        public Usage()
        {
            #region PluginCustomDataBus

            EndpointConfiguration configuration = new EndpointConfiguration();
            configuration.UseDataBus(typeof(CustomDataBus));

            #endregion
        }
开发者ID:fivec,项目名称:docs.particular.net,代码行数:9,代码来源:Usage.cs

示例7: AsyncMain

    static async Task AsyncMain()
    {
        Console.Title = "Samples.DataBus.Sender";
        var endpointConfiguration = new EndpointConfiguration("Samples.DataBus.Sender");
        endpointConfiguration.UseSerialization<JsonSerializer>();

        #region ConfigureDataBus

        var dataBus = endpointConfiguration.UseDataBus<FileShareDataBus>();
        dataBus.BasePath("..\\..\\..\\storage");

        #endregion

        endpointConfiguration.UsePersistence<InMemoryPersistence>();
        endpointConfiguration.EnableInstallers();
        endpointConfiguration.SendFailedMessagesTo("error");
        var endpointInstance = await Endpoint.Start(endpointConfiguration)
            .ConfigureAwait(false);
        try
        {
            Console.WriteLine("Press 'D' to send a databus large message");
            Console.WriteLine("Press 'N' to send a normal large message exceed the size limit and throw");
            Console.WriteLine("Press any other key to exit");

            while (true)
            {
                var key = Console.ReadKey();
                Console.WriteLine();

                if (key.Key == ConsoleKey.N)
                {
                    await SendMessageTooLargePayload(endpointInstance)
                        .ConfigureAwait(false);
                    continue;
                }

                if (key.Key == ConsoleKey.D)
                {
                    await SendMessageLargePayload(endpointInstance)
                        .ConfigureAwait(false);
                    continue;
                }
                return;
            }
        }
        finally
        {
            await endpointInstance.Stop()
                .ConfigureAwait(false);
        }
    }
开发者ID:chriscatilo,项目名称:docs.particular.net,代码行数:51,代码来源:Program.cs

示例8: AsyncMain

 static async Task AsyncMain()
 {
     Console.Title = "Samples.DataBus.Receiver";
     EndpointConfiguration endpointConfiguration = new EndpointConfiguration("Samples.DataBus.Receiver");
     endpointConfiguration.UseSerialization<JsonSerializer>();
     endpointConfiguration.UseDataBus<FileShareDataBus>()
         .BasePath("..\\..\\..\\storage");
     endpointConfiguration.UsePersistence<InMemoryPersistence>();
     endpointConfiguration.EnableInstallers();
     endpointConfiguration.SendFailedMessagesTo("error");
     IEndpointInstance endpoint = await Endpoint.Start(endpointConfiguration);
     try
     {
         Console.WriteLine("Press any key to exit");
         Console.ReadKey();
     }
     finally
     {
         await endpoint.Stop();
     }
 }
开发者ID:odelljl,项目名称:docs.particular.net,代码行数:21,代码来源:Program.cs

示例9: AsyncMain

    static async Task AsyncMain()
    {
        EndpointConfiguration endpointConfiguration = new EndpointConfiguration();
        endpointConfiguration.EndpointName("Samples.Unobtrusive.Client");
        endpointConfiguration.EnableInstallers();
        endpointConfiguration.UsePersistence<InMemoryPersistence>();
        endpointConfiguration.UseDataBus<FileShareDataBus>()
            .BasePath(@"..\..\..\DataBusShare\");
        endpointConfiguration.RijndaelEncryptionService("gdDbqRpqdRbTs3mhdZh8qCaDaxJXl+e7");
        endpointConfiguration.SendFailedMessagesTo("error");

        endpointConfiguration.ApplyCustomConventions();

        IEndpointInstance endpoint = await Endpoint.Start(endpointConfiguration);
        try
        {
            await CommandSender.Start(endpoint);
        }
        finally
        {
            await endpoint.Stop();
        }
    }
开发者ID:fivec,项目名称:docs.particular.net,代码行数:23,代码来源:Program.cs


注:本文中的EndpointConfiguration.UseDataBus方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。