/// <summary>
        /// Creates a new instance of <see cref="IMessagingBus"/>.
        /// </summary>
        /// <returns>
        /// The created instance of <see cref="IMessagingBus"/>
        /// </returns>
        public IMessagingBus BuildSubscribers()
        {
            IMessagingConfig config = CreateConfig();

            config.Validate();

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

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

            if (ServicesBuilder?.NamingStrategy != null)
            {
                fluent.WithNamingStrategy(ServicesBuilder.NamingStrategy);
            }

            if (ServicesBuilder?.MessageContextAccessor != null)
            {
                fluent.WithMessageContextAccessor(ServicesBuilder.MessageContextAccessor());
            }

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

            return(bus);
        }
示例#2
0
        /// <summary>
        /// Creates a new instance of <see cref="IMessagingBus"/>.
        /// </summary>
        /// <returns>
        /// The created instance of <see cref="IMessagingBus"/>
        /// </returns>
        public IMessagingBus BuildSubscribers()
        {
            IMessagingConfig config = MessagingConfig.Build();

            config.Validate();

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

            JustSayingBus          bus     = CreateBus(config, loggerFactory);
            IAwsClientFactoryProxy proxy   = CreateFactoryProxy();
            IVerifyAmazonQueues    creator = new AmazonQueueCreator(proxy, loggerFactory);

            SubscriptionBuilder.Configure(bus, ServiceResolver, creator, proxy, loggerFactory);

            return(bus);
        }
示例#3
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);
        }
示例#4
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);
        }
        /// <summary>
        /// Creates a new instance of <see cref="IMessagingBus"/>.
        /// </summary>
        /// <returns>
        /// The created instance of <see cref="IMessagingBus"/>
        /// </returns>
        public IMessagingBus BuildSubscribers()
        {
            IMessagingConfig config = CreateConfig();

            config.Validate();

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

            JustSayingBus       bus     = CreateBus(config, loggerFactory);
            IVerifyAmazonQueues creator = CreateQueueCreator(loggerFactory);

            if (ServicesBuilder?.MessageContextAccessor != null)
            {
                bus.MessageContextAccessor = ServicesBuilder.MessageContextAccessor();
            }

            if (SubscriptionBuilder != null)
            {
                SubscriptionBuilder.Configure(bus, ServiceResolver, creator, loggerFactory);
            }

            return(bus);
        }