public void SetUp()
        {
            FubuTransport.Reset();

            // Need to do something about this.  Little ridiculous
            var settings = new BusSettings
            {
                Downstream = "lq.tcp://localhost:2020/downstream".ToUri()
            };

            var container = new Container();
            container.Inject(settings);

            _runtime = FubuTransport.For<DelayedRegistry>().StructureMap(container)
                                       .Bootstrap();

            theServiceBus = _runtime.Factory.Get<IServiceBus>();
            _runtime.Factory.Get<IPersistentQueues>().ClearAll();

            theClock = _runtime.Factory.Get<ISystemTime>().As<SettableClock>();

            message1 = new OneMessage();
            message2 = new OneMessage();
            message3 = new OneMessage();
            message4 = new OneMessage();

            theServiceBus.DelaySend(message1, theClock.UtcNow().AddHours(1));
            theServiceBus.DelaySend(message2, theClock.UtcNow().AddHours(1));
            theServiceBus.DelaySend(message3, theClock.UtcNow().AddHours(2));
            theServiceBus.DelaySend(message4, theClock.UtcNow().AddHours(2));
        }
Пример #2
0
		public ServiceBusSettings(BusSettings settings)
		{
			AutoStart = settings.AutoStart;
			ConcurrentConsumerLimit = settings.ConcurrentConsumerLimit;
			ConcurrentReceiverLimit = settings.ConcurrentReceiverLimit;
			ReceiveTimeout = settings.ReceiveTimeout;
			EndpointCache = settings.EndpointCache;
			Network = settings.Network;
		}
Пример #3
0
		public ServiceBusSettings(BusSettings settings)
		{
			AutoStart = settings.AutoStart;
			ConcurrentConsumerLimit = settings.ConcurrentConsumerLimit;
			ConcurrentReceiverLimit = settings.ConcurrentReceiverLimit;
			ReceiveTimeout = settings.ReceiveTimeout;
		    ShutdownTimeout = settings.ShutdownTimeout;
			EndpointCache = settings.EndpointCache;
			Network = settings.Network;
		    EnablePerformanceCounters = settings.EnablePerformanceCounters;
		}
		public static ContainerBuilder RegisterMicroBus(this ContainerBuilder containerBuilder, Func<IHandlerRegister, IHandlerRegister> registerHandlers, Pipeline globalPipeline, BusSettings busSettings)
		{
			containerBuilder.RegisterInstance(busSettings).AsSelf();

			var register = registerHandlers(new HandlerRegister());
			var registrations = register.GetMessageRegistrations();
			RegisterHandlersWithAutofac(containerBuilder, registrations);
			var handlerProvider = HandlerProvider.Create(registrations);
			containerBuilder.RegisterInstance(handlerProvider).As<IHandlerProvider>().SingleInstance();

			RegisterPipelineHandlers(containerBuilder, globalPipeline);
			containerBuilder.RegisterInstance(new GlobalPipelineProvider(globalPipeline)).As<IGlobalPipelineProvider>().SingleInstance();

			containerBuilder.RegisterType<PipelineBuilder>().As<IPipelineBuilder>();
			containerBuilder.RegisterType<AutofacDependencyResolver>().As<IDependencyResolver>();
			containerBuilder.RegisterType<AutofacDependencyScope>().As<IDependencyScope>();
			containerBuilder.RegisterType<GlobalPipelineTracker>().As<IGlobalPipelineTracker>().InstancePerLifetimeScope();
			containerBuilder.RegisterType<MicroBus>().As<IMicroBus>();

			return containerBuilder;
		}
		public static ContainerBuilder RegisterMicroBus(this ContainerBuilder containerBuilder, Func<IHandlerRegister, IHandlerRegister> registerHandlers, BusSettings busSettings)
		{
			return RegisterMicroBus(containerBuilder, registerHandlers, Pipeline.EmptyPipeline, busSettings);
		}
 static BusBuilder DefaultBuilderFactory(BusSettings settings)
 {
     return new ServiceBusBuilderImpl(settings);
 }