本文整理汇总了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
}
示例2: Usage
Usage(EndpointConfiguration endpointConfiguration)
{
#region AzureDataBus
endpointConfiguration.UseDataBus<AzureDataBus>();
#endregion
}
示例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();
}
}
示例4: Usage
Usage(EndpointConfiguration endpointConfiguration)
{
#region PluginCustomDataBus
endpointConfiguration.UseDataBus(typeof(CustomDataBus));
#endregion
}
示例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);
}
}
示例6: Usage
public Usage()
{
#region PluginCustomDataBus
EndpointConfiguration configuration = new EndpointConfiguration();
configuration.UseDataBus(typeof(CustomDataBus));
#endregion
}
示例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);
}
}
示例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();
}
}
示例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();
}
}