public void Customize(EndpointConfiguration endpointConfiguration)
        {
            Log.Info("Customize...");

            var container = ContainerSetup.Create();

            var licensePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "..\\..\\..\\..\\..\\License.xml");

            endpointConfiguration.LicensePath(licensePath);
            endpointConfiguration.UseSerialization <JsonSerializer>();
            endpointConfiguration.Recoverability().Delayed(c => c.NumberOfRetries(0));
            endpointConfiguration.UseContainer <AutofacBuilder>(c => c.ExistingLifetimeScope(container));
            endpointConfiguration.UseTransport <MsmqTransport>()
            .ConnectionString("deadLetter=false;journal=false");
            endpointConfiguration.UsePersistence <NHibernatePersistence>()
            .ConnectionString(ConfigurationManager.ConnectionStrings["Divergent.Sales"].ToString());

            endpointConfiguration.SendFailedMessagesTo("error");
            endpointConfiguration.AuditProcessedMessagesTo("audit");

            ConventionsBuilder conventions = endpointConfiguration.Conventions();

            conventions.DefiningCommandsAs(t => t.Namespace != null && t.Namespace.StartsWith("Divergent") && t.Namespace.EndsWith("Commands") && t.Name.EndsWith("Command"));
            conventions.DefiningEventsAs(t => t.Namespace != null && t.Namespace.StartsWith("Divergent") && t.Namespace.EndsWith("Events") && t.Name.EndsWith("Event"));

            endpointConfiguration.EnableInstallers();
        }
Пример #2
0
        public void Customize(EndpointConfiguration endpointConfiguration)
        {
            Log.Info("Customize...");

            var container = ContainerSetup.Create();

            endpointConfiguration.UseSerialization <JsonSerializer>();
            endpointConfiguration.DisableFeature <SecondLevelRetries>();
            endpointConfiguration.UseContainer <AutofacBuilder>(c => c.ExistingLifetimeScope(container));
            endpointConfiguration.UseTransport <MsmqTransport>()
            .ConnectionString("deadLetter=false;journal=false");
            //endpointConfiguration.UsePersistence<NHibernatePersistence>()
            //    .ConnectionString(ConfigurationManager.ConnectionStrings["Divergent.Sales"].ToString());
            endpointConfiguration.UsePersistence <InMemoryPersistence>();

            endpointConfiguration.SendFailedMessagesTo("error");
            endpointConfiguration.AuditProcessedMessagesTo("audit");

            ConventionsBuilder conventions = endpointConfiguration.Conventions();

            conventions.DefiningCommandsAs(t => t.Namespace != null && t.Namespace.StartsWith("Divergent") && t.Namespace.EndsWith("Commands") && t.Name.EndsWith("Command"));
            conventions.DefiningEventsAs(t => t.Namespace != null && t.Namespace.StartsWith("Divergent") && t.Namespace.EndsWith("Events") && t.Name.EndsWith("Event"));

            endpointConfiguration.EnableInstallers();
        }