Beispiel #1
0
 public void SetServices(IMessageDispatchModule dispatchModule, ISerializationManager serialization,
                         ILoggerFactory loggerFactory)
 {
     DispatchModule = dispatchModule;
     Serialization  = serialization;
     LoggerFactory  = loggerFactory;
 }
 private static HostItemSubscriber[] GetHostSubscribers(IMessageDispatchModule dispatchModule)
 {
     // Finds all message handler methods that subscribe to AMQP Queues and Topics.
     return(dispatchModule.AllMessageTypeDispatchers
            .Values().Where(HostItemSubscriber.IsSubscriber)
            .Select(d => new HostItemSubscriber(d))
            .ToArray());
 }
Beispiel #3
0
        // Delegates to the core message dispatch module to find all message dispatch
        // handlers and filters the list to only those that should be bound to a queue.
        private MessageQueueSubscriber[] GetQueueSubscribers(IMessageDispatchModule messageDispatch)
        {
            var hostId = BusModule.HostAppId;

            return(messageDispatch.AllMessageTypeDispatchers
                   .Values().Where(MessageQueueSubscriber.IsSubscriber)
                   .Select(d => new MessageQueueSubscriber(hostId, d))
                   .ToArray());
        }
Beispiel #4
0
 public InProcessMessagePublisher(
     IServiceProvider services,
     ILogger <InProcessMessagePublisher> logger,
     IMessageDispatchModule eventingModule,
     IEntityScriptingService scriptingSrv)
 {
     _services        = services ?? throw new ArgumentNullException(nameof(services));
     _logger          = logger ?? throw new ArgumentNullException(nameof(logger));
     _messagingModule = eventingModule ?? throw new ArgumentNullException(nameof(eventingModule));
     _scriptingSrv    = scriptingSrv ?? throw new ArgumentNullException(nameof(scriptingSrv));
 }
Beispiel #5
0
        public MessageDispatcher(
            ILogger <MessageDispatcher> logger,
            IMessageDispatchModule messagingModule,
            IEnumerable <IMessageEnricher> messageEnrichers,
            IEnumerable <IMessagePublisher> messagePublishers)
        {
            _logger = logger;

            // Order the enrichers and the publishers based on the order of the type
            // registration specified during configuration.  Order should never matter
            // but this will make the order known.
            _messageEnrichers = messageEnrichers
                                .OrderByMatchingType(messagingModule.DispatchConfig.EnricherTypes)
                                .ToArray();

            _messagePublishers = messagePublishers
                                 .OrderByMatchingType(messagingModule.DispatchConfig.PublisherTypes)
                                 .ToArray();
        }