Beispiel #1
0
 public MessagePublisher(
     IMessageConfiguration configuration,
     IMessagePublisherWrapper publisherWrapper)
 {
     this._configuration = configuration
                           ?? throw new ArgumentNullException(
                                     nameof(configuration));
     this._publisherWrapper = publisherWrapper
                              ?? throw new ArgumentNullException(
                                        nameof(publisherWrapper));
 }
Beispiel #2
0
 public MessagePublisher(
     IMessageDescriptorResolver messageTopicResolver,
     ICoreSessionProvider coreSessionProvider,
     IMessagePublisherWrapper messagePublisherWrapper,
     IPublishedMessageStore messageStore,
     ILogger <MessagePublisher> logger = null)
 {
     _messageTopicResolver    = messageTopicResolver;
     _coreSessionProvider     = coreSessionProvider;
     _messagePublisherWrapper = messagePublisherWrapper;
     _messageStore            = messageStore;
     _logger = (ILogger)logger ?? NullLogger.Instance;
 }
Beispiel #3
0
        public override void PostInitialize()
        {
            RegisterIfNot <IKafkaProducerOption, KafkaProducerOption>();
            RegisterIfNot <IKafkaProducerBuilder, KafkaProducerBuilder>();
            RegisterIfNot <IMessagePublisherWrapper, KafkaProducerWrapper>();
            RegisterIfNot <IMessagePublisher, MessagePublisher>();

            _messagePublisherWrapper = IocManager.Resolve <IMessagePublisherWrapper>();

            var config = IocManager.Resolve
                         <IMessagePublisherModuleConfiguration>();

            if (!config.AutoStart)
            {
                return;
            }
            _messagePublisherWrapper.Connect();
        }