예제 #1
0
 /// <summary>
 /// You can override to configure the local bus; but if you don't call base method,
 /// you will not get the subscription loopback router.
 /// </summary>
 /// <param name="configurator"></param>
 protected virtual void ConfigureLocalBus(IServiceBusConfigurator configurator)
 {
     configurator.AddSubscriptionObserver((bus, coordinator) =>
     {
         _localLoopback = new SubscriptionLoopback(bus, coordinator);
         return(_localLoopback);
     });
 }
 protected virtual void ConfigureRemoteBus(IServiceBusConfigurator configurator)
 {
     RemoteUri = new Uri("loopback://localhost/mt_server");
     configurator.ReceiveFrom(RemoteUri);
     configurator.AddSubscriptionObserver((bus, coordinator) =>
     {
         _remoteLoopback = new SubscriptionLoopback(bus, coordinator);
         return(_remoteLoopback);
     });
 }
 protected virtual void ConfigureLocalBus(IServiceBusConfigurator configurator)
 {
     LocalUri = new Uri("loopback://localhost/mt_client");
     configurator.ReceiveFrom(LocalUri);
     configurator.AddSubscriptionObserver((bus, coordinator) =>
     {
         _localLoopback = new SubscriptionLoopback(bus, coordinator);
         return(_localLoopback);
     });
 }
예제 #4
0
        public static IServiceBusConfigurator UseSubscriptionService(this IServiceBusConfigurator configurator,
                                                                     Action <ISubscriptionClientConfigurator> configureCallback)
        {
            var clientConfigurator = new SubscriptionClientConfigurator();

            configureCallback(clientConfigurator);

            var routerBuilderConfigurator = new SubscriptionRouterBuilderConfigurator(x => x.SetNetwork(null));

            configurator.AddSubscriptionRouterConfigurator(routerBuilderConfigurator);

            configurator.AddSubscriptionObserver(clientConfigurator.Create);
            return(configurator);
        }