コード例 #1
0
        public void ApplyTo(IServiceBusConfigurator configurator)
        {
            if (ObjectBuilder != null)
            {
                configurator.SetObjectBuilder(ObjectBuilder);
            }

            if (ErrorUri != null)
            {
                configurator.SendErrorsTo(ErrorUri);
            }

            configurator.SetReceiveTimeout(ReceiveTimeout);
            configurator.SetConcurrentConsumerLimit(ConcurrentConsumerLimit);
            configurator.SetConcurrentReceiverLimit(ConcurrentReceiverLimit);

            if (!AutoStart)
            {
                configurator.DisableAutoStart();
            }
            if (AutoSubscribe)
            {
                configurator.EnableAutoSubscribe();
            }
        }
コード例 #2
0
        /// <summary>
        /// Implements a distributor-to-worker pattern for the given message type.
        /// </summary>
        /// <typeparam name="T">The type of message to use the distributor</typeparam>
        /// <param name="configurator">Service bus to implement the distributor</param>
        /// <param name="endpointFactory">Factory to generate endpoints from a given URL</param>
        public static void UseDistributorFor <T>(this IServiceBusConfigurator configurator, IEndpointFactory endpointFactory)
            where T : class
        {
            configurator.AddService(() => new Distributor <T>(endpointFactory));

            configurator.SetReceiveTimeout(50.Milliseconds());
        }
コード例 #3
0
        /// <summary>
        /// Implements a distributor-to-worker pattern for the given message type.
        /// </summary>
        /// <typeparam name="T">The type of to use the distributor</typeparam>
        /// <typeparam name="K">The <code>IWorkerSelectionStrategy</code> used to pick
        /// which worker node to send a message</typeparam>
        /// <param name="configurator">Service bus to implement the distributor</param>
        /// <param name="endpointFactory">Factory to generate endpoints from a given URL</param>
        public static void UseDistributorFor <T, K>(this IServiceBusConfigurator configurator, IEndpointFactory endpointFactory)
            where T : class
            where K : class, IWorkerSelectionStrategy <T>, new()
        {
            configurator.AddService(() => new Distributor <T>(endpointFactory, new K()));

            configurator.SetReceiveTimeout(50.Milliseconds());
        }
コード例 #4
0
		public void ApplyTo(IServiceBusConfigurator configurator)
		{
			if (ObjectBuilder != null)
				configurator.SetObjectBuilder(ObjectBuilder);

			if (ErrorUri != null)
				configurator.SendErrorsTo(ErrorUri);

			configurator.SetReceiveTimeout(ReceiveTimeout);
			configurator.SetConcurrentConsumerLimit(ConcurrentConsumerLimit);
			configurator.SetConcurrentReceiverLimit(ConcurrentReceiverLimit);

			if (!AutoStart)
				configurator.DisableAutoStart();
			if (AutoSubscribe)
				configurator.EnableAutoSubscribe();
		}