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


C# EndpointConfiguration.UsePersistence方法代码示例

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


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

示例1: Usage

        public void Usage()
        {

            EndpointConfiguration configuration = new EndpointConfiguration();

            #region DisableSchemaUpdate

            configuration.UsePersistence<NHibernatePersistence>()
                .DisableSchemaUpdate();

            #endregion
            #region DisableGatewaySchemaUpdate

            configuration.UsePersistence<NHibernatePersistence>()
                .DisableGatewayDeduplicationSchemaUpdate();

            #endregion
            #region DisableSubscriptionSchemaUpdate

            configuration.UsePersistence<NHibernatePersistence>()
                .DisableSubscriptionStorageSchemaUpdate();

            #endregion
            #region DisableTimeoutSchemaUpdate

            configuration.UsePersistence<NHibernatePersistence>()
                .DisableTimeoutStorageSchemaUpdate();

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

示例2: Usage

        Usage(EndpointConfiguration endpointConfiguration)
        {
            #region ConfiguringInMemory

            endpointConfiguration.UsePersistence<InMemoryPersistence, StorageType.Sagas>();
            endpointConfiguration.UsePersistence<InMemoryPersistence, StorageType.Subscriptions>();
            endpointConfiguration.UsePersistence<InMemoryPersistence, StorageType.Timeouts>();
            endpointConfiguration.UsePersistence<InMemoryPersistence, StorageType.Outbox>();
            endpointConfiguration.UsePersistence<InMemoryPersistence, StorageType.GatewayDeduplication>();

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

示例3: Setup

        void Setup(EndpointConfiguration endpointConfiguration)
        {
            #region PersistenceOrder_Correct

            endpointConfiguration.UsePersistence<RavenDBPersistence>();

            endpointConfiguration.UsePersistence<NHibernatePersistence, StorageType.Outbox>();

            endpointConfiguration.UsePersistence<InMemoryPersistence, StorageType.GatewayDeduplication>();

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

示例4: Setup2

        void Setup2(EndpointConfiguration endpointConfiguration)
        {
            #region PersistenceOrder_Incorrect

            endpointConfiguration.UsePersistence<NHibernatePersistence, StorageType.Outbox>();

            endpointConfiguration.UsePersistence<InMemoryPersistence, StorageType.GatewayDeduplication>();

            // This one will override the above settings!
            endpointConfiguration.UsePersistence<RavenDBPersistence>();
            #endregion
        }
开发者ID:chriscatilo,项目名称:docs.particular.net,代码行数:12,代码来源:PersistenceOrder.cs

示例5: Setup3

        void Setup3(EndpointConfiguration endpointConfiguration)
        {
            #region PersistenceOrder_Explicit

            endpointConfiguration.UsePersistence<NHibernatePersistence, StorageType.Outbox>();

            endpointConfiguration.UsePersistence<InMemoryPersistence, StorageType.GatewayDeduplication>();

            endpointConfiguration.UsePersistence<RavenDBPersistence, StorageType.Sagas>();
            endpointConfiguration.UsePersistence<RavenDBPersistence, StorageType.Subscriptions>();
            endpointConfiguration.UsePersistence<RavenDBPersistence, StorageType.Timeouts>();
            #endregion
        }
开发者ID:chriscatilo,项目名称:docs.particular.net,代码行数:13,代码来源:PersistenceOrder.cs

示例6: ConfiguringInMemory

        public void ConfiguringInMemory()
        {
            #region ConfiguringInMemory

            EndpointConfiguration configuration = new EndpointConfiguration();

            configuration.UsePersistence<InMemoryPersistence, StorageType.Sagas>();
            configuration.UsePersistence<InMemoryPersistence, StorageType.Subscriptions>();
            configuration.UsePersistence<InMemoryPersistence, StorageType.Timeouts>();
            configuration.UsePersistence<InMemoryPersistence, StorageType.Outbox>();
            configuration.UsePersistence<InMemoryPersistence, StorageType.GatewayDeduplication>();

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

示例7: AsyncMain

    static async Task AsyncMain()
    {

        #region sqlrelay-config
        EndpointConfiguration endpointConfiguration = new EndpointConfiguration();
        endpointConfiguration.SendFailedMessagesTo("error");
        endpointConfiguration.EndpointName("SqlRelay");
        endpointConfiguration.EnableInstallers();
        endpointConfiguration.DisableFeature<AutoSubscribe>();
        endpointConfiguration.UsePersistence<NHibernatePersistence>()
            .ConnectionString(@"Data Source=.\SQLEXPRESS;Initial Catalog=PersistenceForSqlTransport;Integrated Security=True");
        endpointConfiguration.UseTransport<SqlServerTransport>()
            .ConnectionString(@"Data Source=.\SQLEXPRESS;Initial Catalog=PersistenceForSqlTransport;Integrated Security=True");
        #endregion


        IEndpointInstance endpoint = await Endpoint.Start(endpointConfiguration);
        try
        {
            Console.WriteLine("\r\nSqlRelay is running - This endpoint will relay all events received to subscribers. Press any key to stop program\r\n");
            Console.ReadKey();
        }
        finally
        {
            await endpoint.Stop();
        }
    }
开发者ID:fivec,项目名称:docs.particular.net,代码行数:27,代码来源:Program.cs

示例8: Customize

 public void Customize(EndpointConfiguration endpointConfiguration)
 {
     endpointConfiguration.UseSerialization<JsonSerializer>();
     endpointConfiguration.EnableInstallers();
     endpointConfiguration.SendFailedMessagesTo("error");
     endpointConfiguration.UsePersistence<InMemoryPersistence>();
 }
开发者ID:odelljl,项目名称:docs.particular.net,代码行数:7,代码来源:EndpointConfig.cs

示例9: Application_Start

    protected void Application_Start()
    {
        #region ApplicationStart

        ContainerBuilder builder = new ContainerBuilder();

        // Register MVC controllers.
        builder.RegisterControllers(typeof(MvcApplication).Assembly);

        // Set the dependency resolver to be Autofac.
        IContainer container = builder.Build();

        EndpointConfiguration endpointConfiguration = new EndpointConfiguration("Samples.MvcInjection.WebApplication");
        // instruct NServiceBus to use a custom AutoFac configuration
        endpointConfiguration.UseContainer<AutofacBuilder>(c => c.ExistingLifetimeScope(container));
        endpointConfiguration.UseSerialization<JsonSerializer>();
        endpointConfiguration.UsePersistence<InMemoryPersistence>();
        endpointConfiguration.EnableInstallers();
        endpointConfiguration.SendFailedMessagesTo("error");

        endpoint = Endpoint.Start(endpointConfiguration).GetAwaiter().GetResult();

        ContainerBuilder updater = new ContainerBuilder();
        updater.RegisterInstance(endpoint);
        updater.Update(container);

        DependencyResolver.SetResolver(new AutofacDependencyResolver(container));

        AreaRegistration.RegisterAllAreas();
        RegisterRoutes(RouteTable.Routes);

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

示例10: GetConfiguration

        public Task<EndpointConfiguration> GetConfiguration(RunDescriptor runDescriptor, EndpointCustomizationConfiguration endpointConfiguration, IConfigurationSource configSource, Action<EndpointConfiguration> configurationBuilderCustomization)
        {
            var types = GetTypesScopedByTestClass(endpointConfiguration);

            typesToInclude.AddRange(types);

            var builder = new EndpointConfiguration(endpointConfiguration.EndpointName);

            builder.TypesToIncludeInScan(typesToInclude);
            builder.CustomConfigurationSource(configSource);
            builder.EnableInstallers();

            builder.DisableFeature<TimeoutManager>();
            builder.Recoverability()
                .Delayed(delayed => delayed.NumberOfRetries(0))
                .Immediate(immediate => immediate.NumberOfRetries(0));

            builder.RegisterComponents(r => { RegisterInheritanceHierarchyOfContextOnContainer(runDescriptor, r); });

            builder.UsePersistence<InMemoryPersistence>();

            configurationBuilderCustomization(builder);

            return Task.FromResult(builder);
        }
开发者ID:Particular,项目名称:NServiceBus,代码行数:25,代码来源:DefaultServer.cs

示例11: AsyncMain

    static async Task AsyncMain()
    {
        EndpointConfiguration endpointConfiguration = new EndpointConfiguration();
        endpointConfiguration.UsePersistence<InMemoryPersistence>();
        endpointConfiguration.SendFailedMessagesTo("error");

        endpointConfiguration.Routing()
            .UnicastRoutingTable
            .RouteToEndpoint(typeof(DoSomething), "Server");

        IEndpointInstance endpoint = await Endpoint.Start(endpointConfiguration);
        Console.WriteLine("Press enter to send a message");
        Console.WriteLine("Press any key to exit");
        while (true)
        {
            ConsoleKeyInfo key = Console.ReadKey();
            if (key.Key != ConsoleKey.Enter)
            {
                break;
            }
            await endpoint.Send(new DoSomething());
            Console.WriteLine("Message Sent");
        }
        await endpoint.Stop();
    }
开发者ID:fivec,项目名称:docs.particular.net,代码行数:25,代码来源:Program.cs

示例12: AsyncMain

    static async Task AsyncMain()
    {
        Console.Title = "Samples.Logging.CustomFactory";
        #region ConfigureLogging

        var loggerDefinition = LogManager.Use<ConsoleLoggerDefinition>();

        // optionally set the log level in code or read from app.config
        loggerDefinition.Level(LogLevel.Info);

        // logging configuration should occur prior to endpoint configuration
        var endpointConfiguration = new EndpointConfiguration("Samples.Logging.CustomFactory");

        #endregion
        endpointConfiguration.SendFailedMessagesTo("error");
        endpointConfiguration.UseSerialization<JsonSerializer>();
        endpointConfiguration.EnableInstallers();
        endpointConfiguration.UsePersistence<InMemoryPersistence>();

        var endpointInstance = await Endpoint.Start(endpointConfiguration)
            .ConfigureAwait(false);
        try
        {
            var myMessage = new MyMessage();
            await endpointInstance.SendLocal(myMessage)
                .ConfigureAwait(false);
            Console.WriteLine("Press any key to exit");
            Console.ReadKey();
        }
        finally
        {
            await endpointInstance.Stop()
                .ConfigureAwait(false);
        }
    }
开发者ID:chriscatilo,项目名称:docs.particular.net,代码行数:35,代码来源:Program.cs

示例13: AsyncMain

    static async Task AsyncMain()
    {
        Console.Title = "Samples.Throttling.Limited";

        #region LimitConcurrency

        var endpointConfiguration = new EndpointConfiguration("Samples.Throttling.Limited");
        endpointConfiguration.LimitMessageProcessingConcurrencyTo(1);

        #endregion
        endpointConfiguration.UsePersistence<InMemoryPersistence>();
        endpointConfiguration.SendFailedMessagesTo("error");

        #region RegisterBehavior

        endpointConfiguration.Pipeline.Register<ThrottlingRegistration>();

        #endregion

        var endpointInstance = await Endpoint.Start(endpointConfiguration)
            .ConfigureAwait(false);
        try
        {
            Console.WriteLine("Press any key to exit");
            Console.ReadKey();
        }
        finally
        {
            await endpointInstance.Stop()
                .ConfigureAwait(false);
        }
    }
开发者ID:chriscatilo,项目名称:docs.particular.net,代码行数:32,代码来源:Program.cs

示例14: AsyncMain

    static async Task AsyncMain()
    {
        Console.Title = "Samples.Logging.CommonLogging";
        #region ConfigureLogging

        Common.Logging.LogManager.Adapter = new ConsoleOutLoggerFactoryAdapter
        {
            Level = LogLevel.Info
        };

        NServiceBus.Logging.LogManager.Use<CommonLoggingFactory>();

        EndpointConfiguration endpointConfiguration = new EndpointConfiguration("Samples.Logging.CommonLogging");

        #endregion

        endpointConfiguration.UseSerialization<JsonSerializer>();
        endpointConfiguration.EnableInstallers();
        endpointConfiguration.UsePersistence<InMemoryPersistence>();
        endpointConfiguration.SendFailedMessagesTo("error");

        IEndpointInstance endpoint = await Endpoint.Start(endpointConfiguration);
        try
        {
            await endpoint.SendLocal(new MyMessage());
            Console.WriteLine("Press any key to exit");
            Console.ReadKey();
        }
        finally
        {
            await endpoint.Stop();
        }
    }
开发者ID:odelljl,项目名称:docs.particular.net,代码行数:33,代码来源:Program.cs

示例15: AsyncMain

    static async Task AsyncMain()
    {
        EndpointConfiguration endpointConfiguration = new EndpointConfiguration();
        endpointConfiguration.EndpointName("Samples.NHibernateCustomSagaFinder");
        endpointConfiguration.UseSerialization<JsonSerializer>();
        endpointConfiguration.EnableInstallers();

        #region NHibernateSetup

        endpointConfiguration.UsePersistence<NHibernatePersistence>()
            .ConnectionString(@"Data Source=.\SqlExpress;Initial Catalog=NHCustomSagaFinder;Integrated Security=True");

        #endregion

        IEndpointInstance endpoint = await Endpoint.Start(endpointConfiguration);
        try
        {
            await endpoint.SendLocal(new StartOrder
                          {
                              OrderId = "123"
                          });

            Console.WriteLine("Press any key to exit");
            Console.ReadKey();
        }
        finally
        {
            await endpoint.Stop();
        }
    }
开发者ID:fivec,项目名称:docs.particular.net,代码行数:30,代码来源:Program.cs


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