Example #1
0
        /// <summary>
        /// Add ActivityTracing specification for IPipeSpecification[ConsumeContext].
        /// </summary>
        /// <param name="value"></param>
        /// <exception cref="ArgumentNullException"></exception>
        public static void LinkActivityTracingContext(this IBusFactoryConfigurator value)
        {
            if (value == null)
            {
                throw new ArgumentNullException(nameof(value));
            }

            value.AddPipeSpecification(new ActivityTracingPipeSpecification());
        }
Example #2
0
        /// <summary>
        /// Uses the Amazon SQS delayed messages to schedule messages for future delivery. A lightweight
        /// alternative to Quartz, which does not require any storage outside of AmazonSqs.
        /// </summary>
        /// <param name="configurator"></param>
        public static void UseAmazonSqsMessageScheduler(this IBusFactoryConfigurator configurator)
        {
            if (configurator == null)
            {
                throw new ArgumentNullException(nameof(configurator));
            }

            var specification = new DelayedMessageSchedulerSpecification();

            configurator.AddPipeSpecification(specification);
        }
Example #3
0
        public static void UseRetry(this IBusFactoryConfigurator configurator, Action <IRetryConfigurator> configure)
        {
            if (configurator == null)
            {
                throw new ArgumentNullException(nameof(configurator));
            }

            var observer = new RetryBusObserver();

            configurator.ConnectBusObserver(observer);

            var specification = new ConsumeContextRetryPipeSpecification(observer.Stopping);

            configure?.Invoke(specification);

            configurator.AddPipeSpecification(specification);
        }
        /// <summary>
        /// A Kill Switch monitors a receive endpoint and automatically stops and restarts the endpoint in the presence of consumer faults. The options
        /// can be configured to adjust the trip threshold, restart timeout, and exceptions that are observed by the kill switch. When configured on the bus,
        /// a kill switch is installed on every receive endpoint.
        /// </summary>
        /// <param name="configurator">The bus factory configurator</param>
        /// <param name="configure">Configure the kill switch options</param>
        public static void UseKillSwitch(this IBusFactoryConfigurator configurator, Action <KillSwitchOptions> configure = default)
        {
            if (configurator == null)
            {
                throw new ArgumentNullException(nameof(configurator));
            }

            var options = new KillSwitchOptions();

            configure?.Invoke(options);

            var observer = new KillSwitchReceiveEndpointConfiguratorObserver(options);

            configurator.ConnectEndpointConfigurationObserver(observer);

            configurator.AddPipeSpecification(new ValidateOptions(options));
        }
Example #5
0
 public static void PropagateCorrelationIdContext(this IBusFactoryConfigurator value)
 {
     value.AddPipeSpecification(new CorrelationLoggerSpecification());
 }
Example #6
0
 public static void PropagateOpenTracingContext(this IBusFactoryConfigurator value)
 {
     value.ConfigurePublish(c => c.AddPipeSpecification(new OpenTracingPipeSpecification()));
     value.AddPipeSpecification(new OpenTracingPipeSpecification());
 }
 public static void UseDiagnosticsActivity(this IBusFactoryConfigurator configurator, DiagnosticSource diagnosticSource)
 {
     configurator.ConfigureSend(cfg => cfg.AddPipeSpecification(new DiagnosticsActivityPipeSpecification(diagnosticSource)));
     configurator.ConfigurePublish(cfg => cfg.AddPipeSpecification(new DiagnosticsActivityPipeSpecification(diagnosticSource)));
     configurator.AddPipeSpecification(new DiagnosticsActivityPipeSpecification(diagnosticSource));
 }
 public static void PropagateActivityTracingContext(this IBusFactoryConfigurator value)
 {
     value.ConfigurePublish(configurator => configurator.AddPipeSpecification(new ActivityTracingPipeSpecification()));
     value.ConfigureSend(configurator => configurator.AddPipeSpecification(new ActivityTracingPipeSpecification()));
     value.AddPipeSpecification(new ActivityTracingPipeSpecification());
 }
Example #9
0
 public static void UseAllAboard(this IBusFactoryConfigurator value)
 {
     value.AddPipeSpecification(new ConsumePipeSpecification());
 }