public ServiceBrokerTransportReceiver(ServiceBrokerServiceBusReceiverConfiguration receiverConfiguration, ServiceBrokerServiceBusConfiguration configuration) { messageMapper = configuration.MessageMapper; messageEncoder = configuration.MessageEncoder; ServiceBrokerMessageType = configuration.ServiceBrokerMessageType; if (string.IsNullOrWhiteSpace(ServiceBrokerMessageType)) { throw new InvalidConfigurationException("ServiceBrokerMessageType cannot be null or whitespace."); } ServiceBrokerContract = configuration.ServiceBrokerContract; if (string.IsNullOrWhiteSpace(ServiceBrokerContract)) { throw new InvalidConfigurationException("ServiceBrokerContract cannot be null or whitespace."); } ServiceBrokerService = receiverConfiguration.ServiceBrokerService; if (string.IsNullOrWhiteSpace(ServiceBrokerService)) { throw new InvalidConfigurationException("ServiceBrokerService cannot be null or whitespace."); } ServiceBrokerQueue = receiverConfiguration.ServiceBrokerQueue; if (string.IsNullOrWhiteSpace(ServiceBrokerQueue)) { throw new InvalidConfigurationException("ServiceBrokerQueue cannot be null or whitespace."); } ConnectionString = configuration.ServiceBrokerConnectionString; if (string.IsNullOrWhiteSpace(ConnectionString) && !string.IsNullOrWhiteSpace(configuration.ServiceBrokerConnectionStringName) && ConfigurationManager.ConnectionStrings[configuration.ServiceBrokerConnectionStringName] != null) { ConnectionString = ConfigurationManager.ConnectionStrings[configuration.ServiceBrokerConnectionStringName].ConnectionString; } if (string.IsNullOrWhiteSpace(ConnectionString)) { throw new InvalidConfigurationException("ServiceBrokerConnectionString cannot be null or whitespace."); } MaxRetries = receiverConfiguration.MaxRetries; if (MaxRetries < 0) { MaxRetries = 0; } MaxConcurrency = receiverConfiguration.MaxConcurrency; if (MaxConcurrency < 0) { MaxConcurrency = 0; } if (MaxConcurrency > 0) { workerThreadPool = new Semaphore(MaxConcurrency, MaxConcurrency); } faultManager = new TransportMessageFaultManager(MaxRetries); }
public ServiceBrokerMessageTransport(LightRailConfiguration config, ServiceBrokerMessageTransportConfiguration transportConfiguration) { ServiceBrokerMessageType = transportConfiguration.ServiceBrokerMessageType; if (string.IsNullOrWhiteSpace(ServiceBrokerMessageType)) { throw new InvalidConfigurationException("ServiceBrokerMessageType cannot be Null or WhiteSpace"); } ServiceBrokerContract = transportConfiguration.ServiceBrokerContract; if (string.IsNullOrWhiteSpace(ServiceBrokerContract)) { throw new InvalidConfigurationException("ServiceBrokerContract cannot be Null or WhiteSpace"); } ServiceBrokerQueue = transportConfiguration.ServiceBrokerQueue; if (string.IsNullOrWhiteSpace(ServiceBrokerQueue)) { throw new InvalidConfigurationException("ServiceBrokerQueue cannot be Null or WhiteSpace"); } ServiceBrokerService = transportConfiguration.ServiceBrokerService; if (string.IsNullOrWhiteSpace(ServiceBrokerService)) { throw new InvalidConfigurationException("ServiceBrokerService cannot be Null or WhiteSpace"); } ConnectionString = transportConfiguration.ServiceBrokerConnectionString; if (string.IsNullOrWhiteSpace(ConnectionString) && !string.IsNullOrWhiteSpace(transportConfiguration.ServiceBrokerConnectionStringName) && ConfigurationManager.ConnectionStrings[transportConfiguration.ServiceBrokerConnectionStringName] != null) { ConnectionString = ConfigurationManager.ConnectionStrings[transportConfiguration.ServiceBrokerConnectionStringName].ConnectionString; } if (string.IsNullOrWhiteSpace(ConnectionString)) { throw new InvalidConfigurationException("ServiceBrokerConnectionString cannot be Null or WhiteSpace"); } MaxRetries = transportConfiguration.MaxRetries; if (MaxRetries < 0) { MaxRetries = 0; } MaxConcurrency = transportConfiguration.MaxConcurrency; if (MaxConcurrency < 0) { MaxConcurrency = 0; } if (MaxConcurrency > 0) { workerThreadPool = new Semaphore(MaxConcurrency, MaxConcurrency); } faultManager = new TransportMessageFaultManager(MaxRetries); }
public InMemoryQueueTransportReceiver(InMemoryQueueMessageReceiverConfiguration config, BaseServiceBusConfig serviceBusConfig) { QueueName = config.Address; MaxRetries = config.MaxRetries; if (MaxRetries < 0) { MaxRetries = 0; } MaxConcurrency = config.MaxConcurrency; if (MaxConcurrency < 0) { MaxConcurrency = 0; } faultManager = new TransportMessageFaultManager(MaxRetries); }
public AmqpTransportReceiver(AmqpMessageReceiverConfiguration config, AmqpServiceBusConfiguration serviceBusConfig) { amqpAddress = serviceBusConfig.AmqpAddress; ReceiverLinkAddress = config.ReceiverLinkAddress; MaxRetries = config.MaxRetries; if (MaxRetries < 0) { MaxRetries = 0; } MaxConcurrency = config.MaxConcurrency; if (MaxConcurrency < 0) { MaxConcurrency = 0; } messageMapper = serviceBusConfig.MessageMapper; messageEncoder = serviceBusConfig.MessageEncoder; faultManager = new TransportMessageFaultManager(MaxRetries); }
public MsmqTransport(LightRailConfiguration config, MsmqTransportConfiguration transportConfiguration) { InputQueue = transportConfiguration.InputQueue; if (string.IsNullOrWhiteSpace(InputQueue)) { throw new InvalidConfigurationException("InputQueue cannot be Null or WhiteSpace"); } MaxRetries = transportConfiguration.MaxRetries; if (MaxRetries < 0) { MaxRetries = 0; } MaxConcurrency = transportConfiguration.MaxConcurrency; if (MaxConcurrency < 0) { MaxConcurrency = 0; } if (MaxConcurrency > 0) { workerThreadPool = new Semaphore(MaxConcurrency, MaxConcurrency); } faultManager = new TransportMessageFaultManager(MaxRetries); }