Esempio n. 1
0
        public static void ApplyCommonConfiguration(this EndpointConfiguration endpointConfiguration)
        {
            endpointConfiguration.UseSerialization <JsonSerializer>();
            //endpointConfiguration.Recoverability().Delayed(c => c.NumberOfRetries(0));
            endpointConfiguration.UseTransport <MsmqTransport>()
            .ConnectionString("deadLetter=false;journal=false");

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

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

            endpointConfiguration.EnableInstallers();
        }
Esempio n. 2
0
        public static void ApplyCommonConfiguration(this EndpointConfiguration endpointConfiguration, bool asSendOnly = false, Action <RoutingSettings <LearningTransport> > configureRouting = null)
        {
            endpointConfiguration.UseSerialization <NewtonsoftSerializer>();
            var transportConfig = endpointConfiguration.UseTransport <LearningTransport>();

            configureRouting?.Invoke(transportConfig.Routing());

            if (!asSendOnly)
            {
                endpointConfiguration.UsePersistence <LearningPersistence>();
            }

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

            endpointConfiguration.SendHeartbeatTo(
                serviceControlQueue: "Particular.ServiceControl",
                frequency: TimeSpan.FromSeconds(10),
                timeToLive: TimeSpan.FromSeconds(5));

            endpointConfiguration.AuditSagaStateChanges(
                serviceControlQueue: "Particular.ServiceControl");

            var messageConventions = endpointConfiguration.Conventions();

            messageConventions.DefiningMessagesAs(t => t.Namespace != null && t.Namespace.EndsWith(".Messages"));
            messageConventions.DefiningEventsAs(t => t.Namespace != null && t.Namespace.EndsWith(".Messages.Events"));
            messageConventions.DefiningCommandsAs(t => t.Namespace != null && t.Namespace.EndsWith(".Messages.Commands"));

            if (asSendOnly)
            {
                endpointConfiguration.SendOnly();
            }
            else
            {
                var metrics = endpointConfiguration.EnableMetrics();
                metrics.SendMetricDataToServiceControl(
                    serviceControlMetricsAddress: "Particular.Monitoring",
                    interval: TimeSpan.FromSeconds(5));
            }
        }
Esempio n. 3
0
 public static void UseAttributeConventions(this EndpointConfiguration endpointConfiguration)
 {
     endpointConfiguration.Conventions().Add(new MessageAttributeConventions());
 }