示例#1
0
        public override void SetUp()
        {
            _latched   = false;
            _unlatched = false;
            _pingFails = false;

            theSettings = new AdvancedSettings(null);

            _endpoint     = Substitute.For <Endpoint>();
            theRetryAgent =
                new LightweightSendingAgent(TransportLogger.Empty(), MessageLogger.Empty(), this, theSettings, _endpoint);

            for (var i = 0; i < batches.Length; i++)
            {
                batches[i] = batchForEnvelopes(15);
            }

            _enqueued.Clear();
        }
示例#2
0
        public ISendingAgent BuildSendingAgent(Uri uri, CancellationToken cancellation)
        {
            var batchedSender = new BatchedSender(uri, new HttpSenderProtocol(_settings, _httpSettings), cancellation, _logger);

            ISendingAgent agent;

            if (uri.IsDurable())
            {
                agent = _persistence.BuildSendingAgent(uri, batchedSender, cancellation);
            }
            else
            {
                agent = new LightweightSendingAgent(uri, batchedSender, _logger, _settings);
            }

            agent.DefaultReplyUri = LocalReplyUri;
            agent.Start();

            return(agent);
        }
示例#3
0
        public ISendingAgent BuildSendingAgent(Uri uri, IMessagingRoot root, CancellationToken cancellation)
        {
            var batchedSender = createSender(uri, cancellation);

            ISendingAgent agent;

            if (uri.IsDurable())
            {
                agent = _durableMessagingFactory.BuildSendingAgent(uri, batchedSender, cancellation);
            }
            else
            {
                agent = new LightweightSendingAgent(uri, batchedSender, logger, MessagingSettings);
            }

            agent.DefaultReplyUri = ReplyUri;
            agent.Start();

            return(agent);
        }