コード例 #1
0
        public void a_normal_address_and_its_topic_corresponding_address()
        {
            _queueAddress = AzureServiceBusEndpointAddress.Parse(
                TestDataFactory.ApplicationEndpoint);

            var formatter = new AzureServiceBusMessageNameFormatter();
            _topicName = formatter.GetMessageName(typeof (A)).ToString();

            _topicAddress = _queueAddress.ForTopic(_topicName);

            Assert.Throws<ArgumentNullException>(
                () => _queueAddress.ForTopic(null));
        }
コード例 #2
0
        public void a_normal_address_and_its_topic_corresponding_address()
        {
            _queueAddress = AzureServiceBusEndpointAddress.Parse(
                TestDataFactory.ApplicationEndpoint);

            var formatter = new AzureServiceBusMessageNameFormatter();

            _topicName = formatter.GetMessageName(typeof(A)).ToString();

            _topicAddress = _queueAddress.ForTopic(_topicName);

            Assert.Throws <ArgumentNullException>(
                () => _queueAddress.ForTopic(null));
        }
        /// <summary>
        /// Adds an endpoint for the message type. This will look up all super-classes
        /// of the message's type (running for those as well) and then create
        /// message sinks corresponding to the type of message that is being published.
        /// </summary>
        /// <param name="messageType">The type of message to add an endpoint for.</param>
        void AddEndpointForType(Type messageType)
        {
            IEnumerable <Type> types = _inbound.SubscribeTopicsForPublisher(messageType, _formatter);

            foreach (Type type in types)
            {
                if (_added.Has(type))
                {
                    continue;
                }

                MessageName messageName = _formatter.GetMessageName(type);

                IAzureServiceBusEndpointAddress messageEndpointAddress = _address.ForTopic(messageName.ToString());

                FindOrAddEndpoint(type, messageEndpointAddress);
            }
        }
コード例 #4
0
        /// <summary>
        /// Adds an endpoint for the message type. This will look up all super-classes
        /// of the message's type (running for those as well) and then create
        /// message sinks corresponding to the type of message that is being published.
        /// </summary>
        /// <param name="messageType">The type of message to add an endpoint for.</param>
        void AddEndpointForType(Type messageType)
        {
            using (var management = new AzureManagementEndpointManagement(_address))
            {
                IEnumerable <Type> types = management.CreateTopicsForPublisher(messageType, _formatter);

                foreach (Type type in types)
                {
                    if (_added.ContainsKey(type))
                    {
                        continue;
                    }

                    MessageName messageName = _formatter.GetMessageName(type);

                    IAzureServiceBusEndpointAddress messageEndpointAddress = _address.ForTopic(messageName.ToString());

                    FindOrAddEndpoint(type, messageEndpointAddress);
                }
            }
        }