/// <summary>
        /// Create a new Subscription.
        /// </summary>
        /// <param name="value">The data used to create the subscription</param>
        public void CreateSubscription(ServiceBusEnpointData value) {
            Guard.ArgumentNotNull(value, "value");

            //TODO determine how we can change the filters for an existing registered item
            //ServiceBusNamespaceClient

            lock (lockObject) {

                logger.Info("CreateSubscription {0} Declared {1} MessageTytpe {2}, IsReusable {3} Custom Attribute {4}",
                    value.SubscriptionName,
                    value.DeclaredType.ToString(),
                    value.MessageType.ToString(),
                    value.IsReusable,
                    value.AttributeData != null ? value.AttributeData.ToString() : string.Empty);

                var helper = new AzureReceiverHelper(defaultTopic, configurationFactory, configuration, serializer, verifyRetryPolicy, retryPolicy, value);
                mappings.Add(helper);
                //helper.ProcessMessagesForSubscription();

                //TODO make a config setting to allow us to run subscriptions on different threads or not.
                //create a new thread for processing of the messages.
                var t = new Thread(helper.ProcessMessagesForSubscription);
                t.Name = value.SubscriptionName;
                t.IsBackground = false;
                t.Start();

            } //lock end

        }
示例#2
0
        /// <summary>
        /// Create a new Subscription.
        /// </summary>
        /// <param name="value">The data used to create the subscription</param>
        public void CreateSubscription(ServiceBusEnpointData value)
        {
            Guard.ArgumentNotNull(value, "value");

            //TODO determine how we can change the filters for an existing registered item
            //ServiceBusNamespaceClient

            lock (lockObject) {
                logger.Info("CreateSubscription {0} Declared {1} MessageTytpe {2}, IsReusable {3} Custom Attribute {4}",
                            value.SubscriptionName,
                            value.DeclaredType.ToString(),
                            value.MessageType.ToString(),
                            value.IsReusable,
                            value.AttributeData != null ? value.AttributeData.ToString() : string.Empty);

                var helper = new AzureReceiverHelper(defaultTopic, configurationFactory, configuration, serializer, verifyRetryPolicy, retryPolicy, value);
                mappings.Add(helper);
                //helper.ProcessMessagesForSubscription();

                //TODO make a config setting to allow us to run subscriptions on different threads or not.
                //create a new thread for processing of the messages.
                var t = new Thread(helper.ProcessMessagesForSubscription);
                t.Name         = value.SubscriptionName;
                t.IsBackground = false;
                t.Start();
            } //lock end
        }