Ejemplo n.º 1
0
        public MessagingRoot(ObjectPoolProvider pooling,
                             MessagingSettings settings,
                             HandlerGraph handlers,
                             Forwarders forwarders,
                             IDurableMessagingFactory factory,
                             IChannelGraph channels,
                             ISubscriptionsRepository subscriptions,
                             IMessageLogger messageLogger,
                             IEnumerable <ISerializerFactory> serializers,
                             IEnumerable <IMessageDeserializer> readers,
                             IEnumerable <IMessageSerializer> writers,
                             ITransport[] transports,
                             IEnumerable <IMissingHandler> missingHandlers,
                             IEnumerable <IUriLookup> lookups, ITransportLogger transportLogger)
        {
            Settings         = settings;
            _handlers        = handlers;
            _transportLogger = transportLogger;
            Replies          = new ReplyWatcher();
            Factory          = factory;
            Channels         = channels;
            Transports       = transports;



            Lookup = new UriAliasLookup(lookups);


            Serialization = new MessagingSerializationGraph(pooling, settings, handlers, forwarders, serializers,
                                                            readers, writers);

            Logger = messageLogger;

            Pipeline = new HandlerPipeline(Serialization, handlers, Replies, Logger, missingHandlers,
                                           this);

            Workers = new WorkerQueue(Logger, Pipeline, settings);

            Router = new MessageRouter(Serialization, channels, subscriptions, handlers, Logger, Lookup, settings);

            // TODO -- ZOMG this is horrible, and I admit it.
            if (Factory is NulloDurableMessagingFactory)
            {
                Factory.As <NulloDurableMessagingFactory>().ScheduledJobs = ScheduledJobs;
            }
        }
Ejemplo n.º 2
0
        public MessagingRoot(
            MessagingSerializationGraph serialization,
            MessagingSettings settings,
            HandlerGraph handlers,
            IDurableMessagingFactory factory,
            IChannelGraph channels,
            ISubscriptionsRepository subscriptions,
            IMessageLogger messageLogger,
            Lamar.IContainer container,
            ITransportLogger transportLogger)
        {
            Settings         = settings;
            _handlers        = handlers;
            _transportLogger = transportLogger;
            Replies          = new ReplyWatcher();
            Factory          = factory;
            Channels         = channels;
            Transports       = container.QuickBuildAll <ITransport>().ToArray();



            Lookup = new UriAliasLookup(container.QuickBuildAll <IUriLookup>());


            Serialization = serialization;

            Logger = messageLogger;

            Pipeline = new HandlerPipeline(Serialization, handlers, Replies, Logger, container.QuickBuildAll <IMissingHandler>(),
                                           this);

            Workers = new WorkerQueue(Logger, Pipeline, settings);

            Router = new MessageRouter(Serialization, channels, subscriptions, handlers, Logger, Lookup, settings);

            // TODO -- ZOMG this is horrible, and I admit it.
            if (Factory is NulloDurableMessagingFactory f)
            {
                f.ScheduledJobs = ScheduledJobs;
            }
        }
Ejemplo n.º 3
0
        public Task exceed_the_timeout()
        {
            var watcher = new ReplyWatcher();

            return(Exception <TimeoutException> .ShouldBeThrownBy(() => watcher.StartWatch <Message1>(Guid.NewGuid(), 1.Seconds())));
        }