Esempio n. 1
0
        /// <summary>
        /// Creates a new instance of <see cref="IMessagePublisher"/>.
        /// </summary>
        /// <returns>
        /// The created instance of <see cref="IMessagePublisher"/>
        /// </returns>
        public IMessagePublisher BuildPublisher()
        {
            IMessagingConfig config = MessagingConfig.Build();

            config.Validate();

            ILoggerFactory loggerFactory = ServiceResolver.ResolveService <ILoggerFactory>();

            JustSayingBus          bus   = CreateBus(config, loggerFactory);
            IAwsClientFactoryProxy proxy = CreateFactoryProxy();

            if (PublicationsBuilder != null)
            {
                PublicationsBuilder.Configure(bus, proxy, loggerFactory);
            }

            return(bus);
        }
Esempio n. 2
0
        /// <summary>
        /// Creates a new instance of <see cref="IMessagePublisher"/>.
        /// </summary>
        /// <returns>
        /// The created instance of <see cref="IMessagePublisher"/>
        /// </returns>
        public IMessagePublisher BuildPublisher()
        {
            IMessagingConfig config = CreateConfig();

            config.Validate();

            ILoggerFactory loggerFactory =
                ServicesBuilder?.LoggerFactory?.Invoke() ?? ServiceResolver.ResolveService <ILoggerFactory>();

            JustSayingBus      publisher = CreateBus(config, loggerFactory);
            JustSayingFluently fluent    = CreateFluent(publisher, loggerFactory);

            if (PublicationsBuilder != null)
            {
                PublicationsBuilder.Configure(fluent);
            }

            return(publisher);
        }