Ejemplo n.º 1
0
        public void Customize(EndpointConfiguration endpointConfiguration)
        {
            Log.Info("Customize...");

            var providerAssemblies = ReflectionHelper.GetAssembliesPath("..\\..\\Providers", ".Data.dll");
            var container          = ContainerSetup.Create(providerAssemblies);

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

            endpointConfiguration.UseSerialization <JsonSerializer>();
            endpointConfiguration.Recoverability().Delayed(c => c.NumberOfRetries(0));
            endpointConfiguration.UseContainer <AutofacBuilder>(c => c.ExistingLifetimeScope(container));
            endpointConfiguration.UseTransport <MsmqTransport>();
            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();
        }
Ejemplo n.º 2
0
        public void Customize(EndpointConfiguration endpointConfiguration)
        {
            Log.Info("Customize...");

            var providerAssemblies = ReflectionHelper.GetAssembliesPath("..\\..\\Providers", ".Data.dll");
            var container          = ContainerSetup.Create(providerAssemblies);

            endpointConfiguration.UseSerialization <JsonSerializer>();
            endpointConfiguration.DisableFeature <SecondLevelRetries>();
            endpointConfiguration.UseContainer <AutofacBuilder>(c => c.ExistingLifetimeScope(container));
            endpointConfiguration.UseTransport <MsmqTransport>();
            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();
        }