public Task <ISendTransport> GetPublishTransport <T>(Uri publishAddress) where T : class { IAmazonSqsMessagePublishTopology <T> publishTopology = _publishTopology.GetMessageTopology <T>(); var sendSettings = publishTopology.GetSendSettings(); IAgent <ModelContext> modelAgent = GetModelAgent(); var configureTopologyFilter = new ConfigureTopologyFilter <SendSettings>(sendSettings, publishTopology.GetBrokerTopology()); var sendTransport = new AmazonSqsSendTransport(modelAgent, configureTopologyFilter, sendSettings.EntityName); sendTransport.Add(modelAgent); _host.Add(sendTransport); return(Task.FromResult <ISendTransport>(sendTransport)); }
ISendTransport GetSendTransport(Uri address) { if (!_busConfiguration.TryGetHost(address, out var hostConfiguration)) { throw new EndpointNotFoundException($"The host was not found for the specified address: {address}"); } var host = hostConfiguration.Host; var settings = host.Topology.SendTopology.GetSendSettings(address); IAgent <ModelContext> modelAgent = GetModelAgent(host); var configureTopologyFilter = new ConfigureTopologyFilter <SendSettings>(settings, settings.GetBrokerTopology()); var transport = new AmazonSqsSendTransport(modelAgent, configureTopologyFilter, settings.EntityName); transport.Add(modelAgent); host.Add(transport); return(transport); }