public AzureBus( IAzureNetQLogger logger, IConventions conventions, IRpc rpc, ISendReceive sendReceive, IAzureAdvancedBus advancedBus, IConnectionConfiguration connectionConfiguration, ISerializer serializer) { Preconditions.CheckNotNull(logger, "logger"); Preconditions.CheckNotNull(conventions, "conventions"); Preconditions.CheckNotNull(rpc, "rpc"); Preconditions.CheckNotNull(sendReceive, "sendReceive"); Preconditions.CheckNotNull(advancedBus, "advancedBus"); Preconditions.CheckNotNull(connectionConfiguration, "connectionConfiguration"); Preconditions.CheckNotNull(serializer, "serializer"); this.logger = logger; this.conventions = conventions; this.rpc = rpc; this.sendReceive = sendReceive; this.advancedBus = advancedBus; this.connectionConfiguration = connectionConfiguration; this.serializer = serializer; this.exceptionHandler = new ExceptionHandler(logger); }
public HandlerCollection(IAzureNetQLogger logger) { Preconditions.CheckNotNull(logger, "logger"); this.logger = logger; this.ThrowOnNoMatchingHandler = true; }
public Rpc( IConventions conventions, IAzureAdvancedBus advancedBus, IConnectionConfiguration connectionConfiguration, ISerializer serializer, IAzureNetQLogger logger) { Preconditions.CheckNotNull(conventions, "conventions"); Preconditions.CheckNotNull(advancedBus, "advancedBus"); Preconditions.CheckNotNull(connectionConfiguration, "configuration"); Preconditions.CheckNotNull(serializer, "serializer"); Preconditions.CheckNotNull(logger, "logger"); this.conventions = conventions; this.advancedBus = advancedBus; this.connectionConfiguration = connectionConfiguration; this.serializer = serializer; this.logger = logger; this.exceptionHandler = new ExceptionHandler(this.logger); }
public static TimerCallback KeepLockAlive(this BrokeredMessage message, IAzureNetQLogger logger) { return(state => message.RenewLockAsync().ContinueWith( t => { if (t.Exception == null) { return; } var exception = t.Exception.Flatten().InnerExceptions.First(); if (exception is MessageLockLostException) { return; } ((Timer)state).Dispose(); logger.ErrorWrite(exception); })); }
public AzureAdvancedBus(IAzureNetQLogger logger, IConnectionConfiguration configuration) { this.namespaceManager = NamespaceManager.CreateFromConnectionString(configuration.ConnectionString); var pairs = configuration.ConnectionString.Split(';').Select(o => o.Split('=')).Where(o => o.Length > 1); var dictionary = pairs.ToDictionary(key => key[0], value => value[1]); var address = this.namespaceManager.Address; int port; if (dictionary.ContainsKey("Endpoint") && dictionary.ContainsKey("RuntimePort") && int.TryParse(dictionary["RuntimePort"], out port)) { var template = new Uri(string.Format("{0}", dictionary["Endpoint"])); address = new UriBuilder(template.Scheme, template.Host, port, template.PathAndQuery).Uri; } var mfs = new MessagingFactorySettings { TokenProvider = this.namespaceManager.Settings.TokenProvider, NetMessagingTransportSettings = { BatchFlushInterval = configuration .BatchingInterval } }; this.messagingFactory = MessagingFactory.Create(address, mfs); this.queues = new ConcurrentDictionary <string, QueueClient>(); this.topics = new ConcurrentDictionary <string, TopicClient>(); this.subscriptions = new ConcurrentDictionary <string, SubscriptionClient>(); this.logger = logger; this.configuration = configuration; }
public HandlerCollectionFactory(IAzureNetQLogger logger) { this.logger = logger; }
public ExceptionHandler(IAzureNetQLogger logger) { this.logger = logger; }