public Task <ISendTransport> GetSendTransport(Uri address) { var host = _hosts.GetHost(address); var sendSettings = host.Topology.GetSendSettings(address); var topology = host.Topology.SendTopology.GetBrokerTopology(address); var modelCache = new RabbitMqModelCache(host); var configureTopologyFilter = new ConfigureTopologyFilter <SendSettings>(sendSettings, topology); return(Task.FromResult <ISendTransport>(new RabbitMqSendTransport(modelCache, configureTopologyFilter, sendSettings.ExchangeName))); }
public Task<ISendTransport> GetSendTransport(Uri address) { var sendSettings = address.GetSendSettings(); var hostSettings = address.GetHostSettings(); var host = _hosts.FirstOrDefault(x => RabbitMqHostEqualityComparer.Default.Equals(hostSettings, x.Settings)); if (host == null) throw new EndpointNotFoundException("The endpoint address specified an unknown host: " + address); var modelCache = new RabbitMqModelCache(host.ConnectionCache, host.Supervisor, _settings); return Task.FromResult<ISendTransport>(new RabbitMqSendTransport(modelCache, sendSettings)); }
public Task <ISendTransport> GetSendTransport(Uri address) { var host = _hosts.GetHosts(address).FirstOrDefault(); if (host == null) { throw new EndpointNotFoundException("The endpoint address specified an unknown host: " + address); } var sendSettings = address.GetSendSettings(); var modelCache = new RabbitMqModelCache(host); return(Task.FromResult <ISendTransport>(new RabbitMqSendTransport(modelCache, sendSettings))); }
Task <ISendEndpoint> CreateSendEndpoint(Type messageType) { SendSettings sendSettings = _host.GetSendSettings(messageType); ExchangeBindingSettings[] bindings = TypeMetadataCache.GetMessageTypes(messageType) .SelectMany(type => type.GetExchangeBindings(_host.MessageNameFormatter)) .Where(binding => !sendSettings.ExchangeName.Equals(binding.Exchange.ExchangeName)) .ToArray(); Uri destinationAddress = _host.Settings.GetSendAddress(sendSettings); var modelCache = new RabbitMqModelCache(_host.ConnectionCache); var sendTransport = new RabbitMqSendTransport(modelCache, sendSettings, bindings); return(Task.FromResult <ISendEndpoint>(new SendEndpoint(sendTransport, _serializer, destinationAddress, _sourceAddress, SendPipe.Empty))); }
public Task <ISendTransport> GetSendTransport(Uri address) { SendSettings sendSettings = address.GetSendSettings(); RabbitMqHostSettings hostSettings = address.GetHostSettings(); IRabbitMqHost host = _hosts.FirstOrDefault(x => RabbitMqHostEqualityComparer.Default.Equals(hostSettings, x.Settings)); if (host == null) { throw new EndpointNotFoundException("The endpoint address specified an unknown host: " + address); } var modelCache = new RabbitMqModelCache(host.ConnectionCache); return(Task.FromResult <ISendTransport>(new RabbitMqSendTransport(modelCache, sendSettings))); }
Task<ISendEndpoint> CreateSendEndpoint(Type messageType) { SendSettings sendSettings = _host.GetSendSettings(messageType); ExchangeBindingSettings[] bindings = TypeMetadataCache.GetMessageTypes(messageType) .SelectMany(type => type.GetExchangeBindings(_host.MessageNameFormatter)) .Where(binding => !sendSettings.ExchangeName.Equals(binding.Exchange.ExchangeName)) .ToArray(); Uri destinationAddress = _host.Settings.GetSendAddress(sendSettings); var modelCache = new RabbitMqModelCache(_host.ConnectionCache); var sendTransport = new RabbitMqSendTransport(modelCache, sendSettings, bindings); return Task.FromResult<ISendEndpoint>(new SendEndpoint(sendTransport, _serializer, destinationAddress, _sourceAddress, SendPipe.Empty)); }
Task <CachedSendEndpoint <TypeKey> > CreateSendEndpoint <T>(TypeKey typeKey, IRabbitMqMessagePublishTopology <T> publishTopology) where T : class { var sendSettings = publishTopology.GetSendSettings(); var builder = new PublishEndpointBrokerTopologyBuilder(_host.Topology.PublishTopology.BrokerTopologyOptions); publishTopology.Apply(builder); var topology = builder.BuildTopologyLayout(); var modelCache = new RabbitMqModelCache(_host); var sendTransport = new RabbitMqSendTransport(modelCache, new ConfigureTopologyFilter <SendSettings>(sendSettings, topology), sendSettings.ExchangeName); sendTransport.ConnectSendObserver(_sendObservable); var sendEndpoint = new SendEndpoint(sendTransport, _serializer, typeKey.Address, _sourceAddress, SendPipe.Empty); return(Task.FromResult(new CachedSendEndpoint <TypeKey>(typeKey, sendEndpoint))); }
Task <ISendEndpoint> CreateSendEndpoint(Type messageType) { if (!TypeMetadataCache.IsValidMessageType(messageType)) { throw new MessageException(messageType, "Anonymous types are not valid message types"); } var sendSettings = _host.Settings.GetSendSettings(messageType); ExchangeBindingSettings[] bindings = TypeMetadataCache.GetMessageTypes(messageType) .SelectMany(type => type.GetExchangeBindings(_host.Settings.MessageNameFormatter)) .Where(binding => !sendSettings.ExchangeName.Equals(binding.Exchange.ExchangeName)) .ToArray(); var destinationAddress = _host.Settings.GetSendAddress(sendSettings); var modelCache = new RabbitMqModelCache(_host.ConnectionCache, _host.Supervisor, _modelSettings); var sendTransport = new RabbitMqSendTransport(modelCache, sendSettings, bindings); return(Task.FromResult <ISendEndpoint>(new SendEndpoint(sendTransport, _serializer, destinationAddress, _sourceAddress, SendPipe.Empty))); }