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); }