public Task <ISendTransport> CreatePublishTransport <T>() where T : class { IAmazonSqsMessagePublishTopology <T> publishTopology = _topology.Publish <T>(); var sendSettings = publishTopology.GetPublishSettings(); var clientContextSupervisor = new AmazonSqsClientContextSupervisor(_host.ConnectionContextSupervisor); var configureTopologyFilter = new ConfigureTopologyFilter <PublishSettings>(sendSettings, publishTopology.GetBrokerTopology()); var sendTransport = new TopicSendTransport(clientContextSupervisor, configureTopologyFilter, sendSettings.EntityName); sendTransport.Add(clientContextSupervisor); _host.Add(sendTransport); return(Task.FromResult <ISendTransport>(sendTransport)); }
public Task <ISendTransport> CreatePublishTransport <T>() where T : class { IAmazonSqsMessagePublishTopology <T> publishTopology = _hostTopology.Publish <T>(); var settings = publishTopology.GetPublishSettings(_hostConfiguration.HostAddress); var clientContextSupervisor = new AmazonSqsClientContextSupervisor(ConnectionContextSupervisor); var configureTopologyPipe = new ConfigureTopologyFilter <PublishSettings>(settings, publishTopology.GetBrokerTopology()).ToPipe(); var transportContext = new HostSqsSendTransportContext(clientContextSupervisor, configureTopologyPipe, settings.EntityName, SendLogContext, _hostConfiguration.Settings.AllowTransportHeader); var transport = new TopicSendTransport(transportContext); Add(transport); return(Task.FromResult <ISendTransport>(transport)); }