本文整理汇总了C#中BusConfiguration.DisableDurableMessages方法的典型用法代码示例。如果您正苦于以下问题:C# BusConfiguration.DisableDurableMessages方法的具体用法?C# BusConfiguration.DisableDurableMessages怎么用?C# BusConfiguration.DisableDurableMessages使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BusConfiguration
的用法示例。
在下文中一共展示了BusConfiguration.DisableDurableMessages方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DisableDurable
DisableDurable(BusConfiguration busConfiguration)
{
#region set-to-non-durable
busConfiguration.DisableDurableMessages();
#endregion
}
示例2: DisableDurable
public DisableDurable()
{
#region set-to-non-durable
BusConfiguration busConfiguration = new BusConfiguration();
busConfiguration.DisableDurableMessages();
#endregion
}
示例3: Simple
public void Simple()
{
#region StaticConfigureEndpoint
BusConfiguration busConfiguration = new BusConfiguration();
// SendOnly
Bus.CreateSendOnly(busConfiguration);
// AsVolatile
busConfiguration.Transactions().Disable();
busConfiguration.DisableDurableMessages();
busConfiguration.UsePersistence<InMemoryPersistence>();
// DisableDurableMessages
busConfiguration.DisableDurableMessages();
// EnableDurableMessages
busConfiguration.EnableDurableMessages();
#endregion
}
示例4: Main
static void Main(string[] args)
{
LogManager.Use<DefaultFactory>().Level(LogLevel.Fatal); //Comment out to see log messages
BusConfiguration busConfiguration = new BusConfiguration();
busConfiguration.EndpointName("nservicebus_test_client");
busConfiguration.UseTransport<RabbitMQTransport>()
.ConnectionString(ConfigurationManager.AppSettings["ServerConnectionString"]);
busConfiguration.UseSerialization<JsonSerializer>();
busConfiguration.UsePersistence<InMemoryPersistence>();
busConfiguration.EnableInstallers();
busConfiguration.DisableDurableMessages();
busConfiguration.DiscardFailedMessagesInsteadOfSendingToErrorQueue();
bool expectReply = Boolean.Parse(ConfigurationManager.AppSettings["ExpectReply"]);
var taskCount = Int32.Parse(ConfigurationManager.AppSettings["NoOfThreads"]);
var iterationsPerTask = Int32.Parse(ConfigurationManager.AppSettings["MessagesPerThread"]);
IBus bus = Bus.Create(busConfiguration).Start();
Task[] tasks = new Task[taskCount];
for (int t = 0; t < taskCount; t++)
{
tasks[t] = new Task(() =>
{
Message msg;
for (int i = 0; i < iterationsPerTask; i++)
{
msg = new Message { Body = BodyGenerator.GetNext() };
if (expectReply)
{
bus.Send("nservicebus_test_service", msg).Register((m) => { }).Wait();
}
else
{
bus.Send("nservicebus_test_service", msg);
}
}
}, TaskCreationOptions.LongRunning);
}
Console.WriteLine("Sending " + iterationsPerTask * taskCount + " messages across " + taskCount + " threads");
Stopwatch watch = new Stopwatch();
watch.Start();
for (int t = 0; t < taskCount; t++)
{
tasks[t].Start();
}
Task.WaitAll(tasks);
watch.Stop();
Console.WriteLine("Total time: " + watch.Elapsed);
Console.ReadKey();
bus.Dispose();
}
示例5: Main
static void Main(string[] args)
{
var testCaseToRun = args[0];
int numberOfThreads;
if (!int.TryParse(testCaseToRun, out numberOfThreads))
{
var testCase = TestCase.Load(testCaseToRun,args);
testCase.Run();
testCase.DumpSettings();
return;
}
var volatileMode = (args[4].ToLower() == "volatile");
var suppressDTC = (args[4].ToLower() == "suppressdtc");
var twoPhaseCommit = (args[4].ToLower() == "twophasecommit");
var saga = (args[5].ToLower() == "sagamessages");
var encryption = (args[5].ToLower() == "encryption");
var concurrency = int.Parse(args[7]);
TransportConfigOverride.MaximumConcurrencyLevel = numberOfThreads;
var numberOfMessages = int.Parse(args[1]);
var endpointName = "PerformanceTest";
if (volatileMode)
endpointName += ".Volatile";
if (suppressDTC)
endpointName += ".SuppressDTC";
var configuration = new BusConfiguration();
configuration.EndpointName(endpointName);
configuration.EnableInstallers();
configuration.DiscardFailedMessagesInsteadOfSendingToErrorQueue();
configuration.UseTransport<MsmqTransport>().ConnectionString("deadLetter=false;journal=false");
configuration.DisableFeature<Audit>();
if (volatileMode)
{
configuration.DisableDurableMessages();
configuration.UsePersistence<InMemoryPersistence>();
}
switch (args[3].ToLower())
{
case "msmq":
configuration.UseTransport<MsmqTransport>();
break;
default:
throw new InvalidOperationException("Illegal transport " + args[2]);
}
if (suppressDTC)
{
configuration.Transactions().DisableDistributedTransactions();
}
switch (args[2].ToLower())
{
case "xml":
configuration.UseSerialization<XmlSerializer>();
break;
case "json":
configuration.UseSerialization<JsonSerializer>();
break;
case "bson":
configuration.UseSerialization<BsonSerializer>();
break;
case "bin":
configuration.UseSerialization<BinarySerializer>();
break;
default:
throw new InvalidOperationException("Illegal serialization format " + args[2]);
}
configuration.UsePersistence<InMemoryPersistence>();
configuration.RijndaelEncryptionService("KEY", Encoding.ASCII.GetBytes("gdDbqRpqdRbTs3mhdZh9qCaDaxJXl+e6"));
using (var startableBus = Bus.Create(configuration))
{
if (saga)
{
SeedSagaMessages(startableBus,numberOfMessages, endpointName, concurrency);
}
else
{
Statistics.SendTimeNoTx = SeedInputQueue(startableBus,numberOfMessages / 2, endpointName, numberOfThreads, false, twoPhaseCommit, encryption);
Statistics.SendTimeWithTx = SeedInputQueue(startableBus,numberOfMessages / 2, endpointName, numberOfThreads, true, twoPhaseCommit, encryption);
}
//.........这里部分代码省略.........