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


C# BusConfiguration.UseDataBus方法代码示例

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


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

示例1: Complex

        public void Complex()
        {
            BusConfiguration busConfiguration = new BusConfiguration();
            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 AzureDataBusConfiguration

            DataBusExtentions<AzureDataBus> dataBus = busConfiguration.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:cdnico,项目名称:docs.particular.net,代码行数:28,代码来源:Usage.cs

示例2: Customize

        public void Customize(BusConfiguration configuration)
        {
            XmlConfigurator.Configure();
            configuration.UseContainer<NinjectBuilder>(k => k.ExistingKernel(CreateKernel()));
            configuration.RegisterComponents(x => x.ConfigureComponent<IRepository>(
                builder =>
                {
                    return new Repository(() =>
                    {
                        var nh = builder.Build<NHibernateStorageContext>();
                        var e = new OrderContext((DbConnection)nh.Connection);
                        return e;
                    });
                },
                DependencyLifecycle.InstancePerUnitOfWork));
            configuration.RegisterComponents(components => components.ConfigureComponent<UnitOfWork>(DependencyLifecycle.InstancePerUnitOfWork));

            configuration.UsePersistence<NHibernatePersistence>();
            configuration.UseTransport<MsmqTransport>();
            configuration.UseDataBus<FileShareDataBus>().BasePath(Constants.NServiceBus_DataBusBasePath);
            configuration.RijndaelEncryptionService();
            configuration.Transactions();
            configuration.EnableOutbox();
            configuration.Conventions().OrderConventions();
            //
        }
开发者ID:eraj2587,项目名称:NserviceBusDemo,代码行数:26,代码来源:EndpointConfig.cs

示例3: Define

 Define(BusConfiguration busConfiguration)
 {
     #region DefineFileLocationForDatabusFiles
     var dataBus = busConfiguration.UseDataBus<FileShareDataBus>();
     dataBus.BasePath(@"\\share\databus_attachments\");
     #endregion
 }
开发者ID:chriscatilo,项目名称:docs.particular.net,代码行数:7,代码来源:Define.cs

示例4: Main

    static void Main()
    {
        BusConfiguration busConfiguration = new BusConfiguration();
        busConfiguration.EndpointName("Samples.DataBus.Sender");
        busConfiguration.UseSerialization<JsonSerializer>();
        busConfiguration.UseDataBus<FileShareDataBus>().BasePath(BasePath);
        busConfiguration.UsePersistence<InMemoryPersistence>();
        busConfiguration.EnableInstallers();
        using (IBus bus = Bus.Create(busConfiguration).Start())
        {
            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)
            {
                ConsoleKeyInfo key = Console.ReadKey();
                Console.WriteLine();

                if (key.Key == ConsoleKey.N)
                {
                    SendMessageTooLargePayload(bus);
                    continue;
                }

                if (key.Key == ConsoleKey.D)
                {
                    SendMessageLargePayload(bus);
                    continue;
                }
                return;
            }
        }
    }
开发者ID:RichieYang,项目名称:docs.particular.net,代码行数:34,代码来源:Program.cs

示例5: Simple

        void Simple(BusConfiguration busConfiguration)
        {
            #region AzureDataBus

            busConfiguration.UseDataBus<AzureDataBus>();

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

示例6: Usage

        Usage(BusConfiguration busConfiguration)
        {
            #region PluginCustomDataBus

            busConfiguration.UseDataBus(typeof(CustomDataBus));

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

示例7: Customize

        public void Customize(BusConfiguration configuration)
        {
            configuration.UseSerialization<JsonSerializer>();
            configuration.UsePersistence<MongoDBPersistence>()
                .SetDatabaseName("MyDatabase");

            configuration.UseDataBus<MongoDBDataBus>();
        }
开发者ID:freemsly,项目名称:NServiceBus.MongoDB,代码行数:8,代码来源:EndpointConfig.cs

示例8: Usage

        public Usage()
        {
            #region PluginCustomDataBus

            BusConfiguration busConfiguration = new BusConfiguration();
            busConfiguration.UseDataBus(typeof(CustomDataBus));

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

示例9: Simple

        public void Simple()
        {
            #region AzureDataBus

            BusConfiguration busConfiguration = new BusConfiguration();
            busConfiguration.UseDataBus<AzureDataBus>();

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

示例10: Usage

        public Usage()
        {
            string databusPath = null;

            #region FileShareDataBus

            BusConfiguration busConfiguration = new BusConfiguration();
            busConfiguration.UseDataBus<FileShareDataBus>()
                .BasePath(databusPath);

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

示例11: Main

 static void Main()
 {
     BusConfiguration busConfiguration = new BusConfiguration();
     busConfiguration.EndpointName("Samples.DataBus.Receiver");
     busConfiguration.UseSerialization<JsonSerializer>();
     busConfiguration.UseDataBus<FileShareDataBus>().BasePath(BasePath);
     busConfiguration.UsePersistence<InMemoryPersistence>();
     busConfiguration.EnableInstallers();
     using (IBus bus = Bus.Create(busConfiguration).Start())
     {
         Console.WriteLine("Press any key to exit");
         Console.ReadKey();
     }
 }
开发者ID:cdnico,项目名称:docs.particular.net,代码行数:14,代码来源:Program.cs

示例12: Main

 static void Main()
 {
     BusConfiguration busConfiguration = new BusConfiguration();
     busConfiguration.EndpointName("Samples.AzureBlobStorageDataBus.Receiver");
     busConfiguration.UseSerialization<JsonSerializer>();
     busConfiguration.UseDataBus<AzureDataBus>()
         .ConnectionString("UseDevelopmentStorage=true");
     busConfiguration.UsePersistence<InMemoryPersistence>();
     busConfiguration.EnableInstallers();
     using (IBus bus = Bus.Create(busConfiguration).Start())
     {
         Console.WriteLine("\r\nPress enter key to stop program\r\n");
         Console.Read();
     }
 }
开发者ID:cdnico,项目名称:docs.particular.net,代码行数:15,代码来源:Program.cs

示例13: Main

    public static void Main()
    {
        BusConfiguration busConfiguration = new BusConfiguration();
        busConfiguration.EndpointName("Samples.Unobtrusive.Server");
        busConfiguration.EnableInstallers();
        busConfiguration.UsePersistence<InMemoryPersistence>();
        busConfiguration.UseDataBus<FileShareDataBus>()
            .BasePath(@"..\..\..\DataBusShare\");
        busConfiguration.RijndaelEncryptionService("gdDbqRpqdRbTs3mhdZh8qCaDaxJXl+e7");

        busConfiguration.ApplyCustomConventions();

        using (IBus bus = Bus.Create(busConfiguration).Start())
        {
            CommandSender.Start(bus);
        }
    }
开发者ID:cdnico,项目名称:docs.particular.net,代码行数:17,代码来源:Program.cs

示例14: Main

    public static void Main()
    {
        BusConfiguration busConfiguration = new BusConfiguration();

        busConfiguration.EnableInstallers();
        busConfiguration.UsePersistence<InMemoryPersistence>();
        busConfiguration.UseDataBus<FileShareDataBus>()
            .BasePath(@"..\..\..\DataBusShare\");
        busConfiguration.RijndaelEncryptionService();

        busConfiguration.ApplyCustomConventions();

        using (IBus bus = Bus.Create(busConfiguration).Start())
        {
            CommandSender.Start(bus);
        }
    }
开发者ID:ryanrdl,项目名称:docs.particular.net,代码行数:17,代码来源:Program.cs

示例15: Customize

		public void Customize( BusConfiguration configuration )
		{
			configuration.UsePersistence<InMemoryPersistence>();

			configuration.Conventions()
				.DefiningDataBusPropertiesAs( pi => pi.Name.StartsWith( "Large" ) )
				.DefiningCommandsAs( t => t.Namespace != null && t.Namespace.EndsWith( ".Commands" ) )
				.DefiningEventsAs( t => t.Namespace != null && t.Namespace.EndsWith( ".Events" ) );

			//configuration.UseDataBus<FileShareDataBus>();

			//configuration.RegisterComponents( c =>
			//{
			//	c.RegisterSingleton<IDataBus>( new CustomDataBus() );
			//} );

			configuration.UseDataBus( typeof( CustomDataBus ) );
		}
开发者ID:modulexcite,项目名称:NServiceBus.Samples,代码行数:18,代码来源:EndpointConfig.cs


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