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


C# BusConfiguration.DisableDurableMessages方法代码示例

本文整理汇总了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
        }
开发者ID:odelljl,项目名称:docs.particular.net,代码行数:8,代码来源:DisableDurable.cs

示例2: DisableDurable

        public DisableDurable()
        {
            #region set-to-non-durable

            BusConfiguration busConfiguration = new BusConfiguration();
            busConfiguration.DisableDurableMessages();

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

示例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
        }
开发者ID:ryanrdl,项目名称:docs.particular.net,代码行数:22,代码来源:StaticConfigureEndpoint.cs

示例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();


        }
开发者ID:tenor,项目名称:RestBus.Benchmarks,代码行数:61,代码来源:Program.cs

示例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);
                }
//.........这里部分代码省略.........
开发者ID:xqfgbc,项目名称:NServiceBus,代码行数:101,代码来源:Program.cs


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