Example #1
0
 /// <summary>
 /// The <see cref="CommandProcessor"/> wants to support <see cref="CommandProcessor.Post{T}(T)"/> or <see cref="CommandProcessor.Repost"/> using an external bus.
 /// You need to provide a policy to specify how QoS issues, specifically <see cref="CommandProcessor.RETRYPOLICY "/> or <see cref="CommandProcessor.CIRCUITBREAKER "/>
 /// are handled by adding appropriate <see cref="Policies"/> when choosing this option.
 ///
 /// </summary>
 /// <param name="configuration">The Task Queues configuration.</param>
 /// <param name="outbox">The Outbox.</param>
 /// <param name="boxTransactionConnectionProvider"></param>
 /// <returns>INeedARequestContext.</returns>
 public INeedARequestContext ExternalBus(ExternalBusConfiguration configuration, IAmAnOutbox <Message> outbox, IAmABoxTransactionConnectionProvider boxTransactionConnectionProvider = null)
 {
     _useExternalBus = true;
     _producers      = configuration.ProducerRegistry;
     _outbox         = outbox;
     _overridingBoxTransactionConnectionProvider = boxTransactionConnectionProvider;
     _messageMapperRegistry = configuration.MessageMapperRegistry;
     _outboxWriteTimeout    = configuration.OutboxWriteTimeout;
     return(this);
 }
Example #2
0
        /// <summary>
        /// The <see cref="CommandProcessor"/> wants to support <see cref="CommandProcessor.Call{T}(T)"/> using RPC between client and server
        /// </summary>
        /// <param name="configuration"></param>
        /// <param name="outbox">The outbox</param>
        /// <param name="subscriptions">Subscriptions for creating reply queues</param>
        /// <returns></returns>
        public INeedARequestContext ExternalRPC(ExternalBusConfiguration configuration, IAmAnOutbox <Message> outbox, IEnumerable <Subscription> subscriptions)
        {
            _useRequestReplyQueues  = true;
            _replySubscriptions     = subscriptions;
            _producers              = configuration.ProducerRegistry;
            _messageMapperRegistry  = configuration.MessageMapperRegistry;
            _outboxWriteTimeout     = configuration.OutboxWriteTimeout;
            _responseChannelFactory = configuration.ResponseChannelFactory;
            _outbox = outbox;

            return(this);
        }