本文整理汇总了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
}
示例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();
//
}
示例3: Define
Define(BusConfiguration busConfiguration)
{
#region DefineFileLocationForDatabusFiles
var dataBus = busConfiguration.UseDataBus<FileShareDataBus>();
dataBus.BasePath(@"\\share\databus_attachments\");
#endregion
}
示例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;
}
}
}
示例5: Simple
void Simple(BusConfiguration busConfiguration)
{
#region AzureDataBus
busConfiguration.UseDataBus<AzureDataBus>();
#endregion
}
示例6: Usage
Usage(BusConfiguration busConfiguration)
{
#region PluginCustomDataBus
busConfiguration.UseDataBus(typeof(CustomDataBus));
#endregion
}
示例7: Customize
public void Customize(BusConfiguration configuration)
{
configuration.UseSerialization<JsonSerializer>();
configuration.UsePersistence<MongoDBPersistence>()
.SetDatabaseName("MyDatabase");
configuration.UseDataBus<MongoDBDataBus>();
}
示例8: Usage
public Usage()
{
#region PluginCustomDataBus
BusConfiguration busConfiguration = new BusConfiguration();
busConfiguration.UseDataBus(typeof(CustomDataBus));
#endregion
}
示例9: Simple
public void Simple()
{
#region AzureDataBus
BusConfiguration busConfiguration = new BusConfiguration();
busConfiguration.UseDataBus<AzureDataBus>();
#endregion
}
示例10: Usage
public Usage()
{
string databusPath = null;
#region FileShareDataBus
BusConfiguration busConfiguration = new BusConfiguration();
busConfiguration.UseDataBus<FileShareDataBus>()
.BasePath(databusPath);
#endregion
}
示例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();
}
}
示例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();
}
}
示例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);
}
}
示例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);
}
}
示例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 ) );
}