protected override void ConfigureServiceBus(Uri uri, IServiceBusConfigurator configurator) { base.ConfigureServiceBus(uri, configurator); configurator.AddService <SubscriptionPublisher>(); configurator.AddService <SubscriptionConsumer>(); }
/// <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()); }
/// <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()); }
public static void ImplementSagaDistributorWorker <T>(this IServiceBusConfigurator configurator, ISagaRepository <T> repository) where T : SagaStateMachine <T>, ISaga { configurator.AddService(() => new SagaWorker <T>()); }
public static void ImplementDistributorWorker <T>(this IServiceBusConfigurator configurator, Func <T, Action <T> > getConsumer) where T : class { configurator.AddService(() => new Worker <T>(getConsumer)); }
// ReSharper disable UnusedMember.Local private void AddServiceForDataEvent <TMessage>() // ReSharper restore UnusedMember.Local where TMessage : class { _configurator.AddService(() => new Distributor <TMessage>(_endpointFactory)); }
protected void ConnectSubscriptionService(IServiceBusConfigurator configurator, ISubscriptionService subscriptionService) { configurator.AddService(IBusServiceLayer.Session, () => new SubscriptionPublisher(subscriptionService)); configurator.AddService(IBusServiceLayer.Session, () => new SubscriptionConsumer(subscriptionService)); }