コード例 #1
0
        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);
        }
コード例 #2
0
        public HandlerCollection(IAzureNetQLogger logger)
        {
            Preconditions.CheckNotNull(logger, "logger");

            this.logger = logger;
            this.ThrowOnNoMatchingHandler = true;
        }
コード例 #3
0
ファイル: Rpc.cs プロジェクト: tymoor/AzureNetQ
        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);
        }
コード例 #4
0
        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);
            }));
        }
コード例 #5
0
        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;
        }
コード例 #6
0
 public HandlerCollectionFactory(IAzureNetQLogger logger)
 {
     this.logger = logger;
 }
コード例 #7
0
 public ExceptionHandler(IAzureNetQLogger logger)
 {
     this.logger = logger;
 }
コード例 #8
0
ファイル: ExceptionHandler.cs プロジェクト: kangkot/AzureNetQ
 public ExceptionHandler(IAzureNetQLogger logger)
 {
     this.logger = logger;
 }
コード例 #9
0
 public HandlerCollectionFactory(IAzureNetQLogger logger)
 {
     this.logger = logger;
 }