/// <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);
        }
        /// <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);
        }
Exemple #3
0
 private IMessagingConfig CreateConfig()
 {
     return(MessagingConfig != null?
            MessagingConfig.Build() :
                ServiceResolver.ResolveService <IMessagingConfig>());
 }