protected override void ConfigureActiveMqBus(IActiveMqBusFactoryConfigurator configurator)
 {
     configurator.ReceiveEndpoint("input-fault", endpointConfigurator =>
     {
         _faulted = Handled <Fault <TestCommand> >(endpointConfigurator);
     });
 }
 protected override void ConfigureActiveMqBus(IActiveMqBusFactoryConfigurator configurator)
 {
     configurator.UseKillSwitch(options => options
                                .SetActivationThreshold(10)
                                .SetTripThreshold(0.1)
                                .SetRestartTimeout(s: 1));
 }
        /// <summary>
        /// Registers a management endpoint on the bus, which can be used to control
        /// filters and other management control points on the bus.
        /// </summary>
        /// <param name="configurator"></param>
        /// <param name="host">The host where the endpoint is to be created</param>
        /// <param name="configure">Configure additional values of the underlying receive endpoint</param>
        /// <returns></returns>
        public static IManagementEndpointConfigurator ManagementEndpoint(this IActiveMqBusFactoryConfigurator configurator,
                                                                         IActiveMqHost host, Action <IActiveMqReceiveEndpointConfigurator> configure = null)
        {
            if (configurator == null)
            {
                throw new ArgumentNullException(nameof(configurator));
            }

            if (host == null)
            {
                throw new ArgumentNullException(nameof(host));
            }

            var queueName = host.Topology.CreateTemporaryQueueName("manage-");

            IActiveMqReceiveEndpointConfigurator specification = null;

            configurator.ReceiveEndpoint(host, queueName, x =>
            {
                x.AutoDelete = true;
                x.Durable    = false;

                configure?.Invoke(x);

                specification = x;
            });

            var managementEndpointConfigurator = new ManagementEndpointConfigurator(specification);

            return(managementEndpointConfigurator);
        }
Example #4
0
        /// <summary>
        /// Configure a ActiveMQ host with a host name and virtual host
        /// </summary>
        /// <param name="configurator"></param>
        /// <param name="hostName">The host name of the broker</param>
        /// <param name="configure">The configuration callback</param>
        public static IActiveMqHost Host(this IActiveMqBusFactoryConfigurator configurator, string hostName, Action <IActiveMqHostConfigurator> configure)
        {
            if (Uri.IsWellFormedUriString(hostName, UriKind.Absolute))
            {
                return(configurator.Host(new Uri(hostName), configure));
            }

            return(configurator.Host(new ActiveMqHostAddress(hostName, default, "/"), configure));
Example #5
0
        protected override void ConfigureActiveMqBusHost(IActiveMqBusFactoryConfigurator configurator, IActiveMqHost host)
        {
            configurator.ReceiveEndpoint(host, "input_queue_error", x =>
            {
                x.BindMessageTopics = false;

                _errorHandler = Handled <PingMessage>(x);
            });
        }
Example #6
0
        protected override void ConfigureActiveMqBus(IActiveMqBusFactoryConfigurator configurator)
        {
            configurator.ReceiveEndpoint("input_queue_error", x =>
            {
                x.ConfigureConsumeTopology = false;

                _errorHandler = Handled <PingMessage>(x);
            });
        }
Example #7
0
        protected override void ConfigureActiveMqBus(IActiveMqBusFactoryConfigurator configurator)
        {
            _busHealth = new BusHealth();

            configurator.UseKillSwitch(options => options
                                       .SetActivationThreshold(10)
                                       .SetTripThreshold(0.1)
                                       .SetRestartTimeout(s: 1));

            configurator.ConnectBusObserver(_busHealth);
            configurator.ConnectEndpointConfigurationObserver(_busHealth);
        }
Example #8
0
            protected override void ConfigureActiveMqBus(IActiveMqBusFactoryConfigurator configurator)
            {
                configurator.ServiceInstance(instance =>
                {
                    var serviceEndpointName = KebabCaseEndpointNameFormatter.Instance.Consumer <DeployPayloadConsumer>();

                    instance.ReceiveEndpoint(serviceEndpointName, x =>
                    {
                        x.Consumer <DeployPayloadConsumer>();
                    });
                });
            }
Example #9
0
        /// <summary>
        ///     Configure a ActiveMQ host using the configuration API
        /// </summary>
        /// <param name="configurator"></param>
        /// <param name="hostAddress">The URI host address of the ActiveMQ host (activemq://host:port/vhost)</param>
        /// <param name="configure"></param>
        public static IActiveMqHost Host(this IActiveMqBusFactoryConfigurator configurator, Uri hostAddress, Action <IActiveMqHostConfigurator> configure)
        {
            if (hostAddress == null)
            {
                throw new ArgumentNullException(nameof(hostAddress));
            }

            var hostConfigurator = new ActiveMqHostConfigurator(hostAddress);

            configure(hostConfigurator);

            return(configurator.Host(hostConfigurator.Settings));
        }
        /// <summary>
        /// Declare a ReceiveEndpoint using a unique generated queue name. This queue defaults to auto-delete
        /// and non-durable. By default all services bus instances include a default receiveEndpoint that is
        /// of this type (created automatically upon the first receiver binding).
        /// </summary>
        /// <param name="configurator"></param>
        /// <param name="host"></param>
        /// <param name="configure"></param>
        public static void ReceiveEndpoint(this IActiveMqBusFactoryConfigurator configurator, IActiveMqHost host,
                                           Action <IActiveMqReceiveEndpointConfigurator> configure)
        {
            var queueName = host.Topology.CreateTemporaryQueueName("receiveEndpoint-");

            configurator.ReceiveEndpoint(host, queueName, x =>
            {
                x.AutoDelete = true;
                x.Durable    = false;

                configure(x);
            });
        }
Example #11
0
        /// <summary>
        /// Configure a service instance, which supports one or more receive endpoints, all of which are managed by conductor.
        /// </summary>
        /// <param name="configurator"></param>
        /// <param name="configure"></param>
        public static void ServiceInstance(this IActiveMqBusFactoryConfigurator configurator,
                                           Action <IServiceInstanceConfigurator <IActiveMqReceiveEndpointConfigurator> > configure)
        {
            var instanceId           = NewId.Next();
            var instanceEndpointName = ServiceEndpointNameFormatter.Instance.EndpointName(instanceId);

            configurator.ReceiveEndpoint(instanceEndpointName, endpointConfigurator =>
            {
                var instance = new ServiceInstance(instanceId, endpointConfigurator);

                var instanceConfigurator = new ActiveMqServiceInstanceConfigurator(configurator, instance);

                instanceConfigurator.ConfigureInstanceEndpoint(endpointConfigurator);

                configure?.Invoke(instanceConfigurator);
            });
        }
        protected override void ConfigureActiveMqBusHost(IActiveMqBusFactoryConfigurator configurator, IActiveMqHost host)
        {
            base.ConfigureActiveMqBusHost(configurator, host);

            configurator.UseActiveMqMessageScheduler();
        }
Example #13
0
 protected virtual void ConfigureActiveMqBus(IActiveMqBusFactoryConfigurator configurator)
 {
 }
 protected override void ConfigureActiveMqBus(IActiveMqBusFactoryConfigurator configurator)
 {
     configurator.UseActiveMqMessageScheduler();
 }
Example #15
0
 /// <summary>
 /// Configure a ActiveMQ host with a host name and virtual host
 /// </summary>
 /// <param name="configurator"></param>
 /// <param name="hostName">The host name of the broker</param>
 /// <param name="port">The port to connect to the broker</param>
 /// <param name="configure">The configuration callback</param>
 public static IActiveMqHost Host(this IActiveMqBusFactoryConfigurator configurator, string hostName, int port,
                                  Action <IActiveMqHostConfigurator> configure)
 {
     return(configurator.Host(new UriBuilder("activemq", hostName, port).Uri, configure));
 }
Example #16
0
 /// <summary>
 /// Declare a ReceiveEndpoint using a unique generated queue name. This queue defaults to auto-delete
 /// and non-durable. By default all services bus instances include a default receiveEndpoint that is
 /// of this type (created automatically upon the first receiver binding).
 /// </summary>
 /// <param name="configurator"></param>
 /// <param name="host"></param>
 /// <param name="definition"></param>
 /// <param name="configure"></param>
 public static void ReceiveEndpoint(this IActiveMqBusFactoryConfigurator configurator, IActiveMqHost host, IEndpointDefinition definition,
                                    Action <IActiveMqReceiveEndpointConfigurator> configure = null)
 {
     configurator.ReceiveEndpoint(host, definition, DefaultEndpointNameFormatter.Instance, configure);
 }
Example #17
0
 protected virtual void ConfigureActiveMqBusHost(IActiveMqBusFactoryConfigurator configurator, IActiveMqHost host)
 {
 }