コード例 #1
0
        IBrokeredMessageReceiver CreateBrokeredMessageReceiver(string topicPath, string subscriptionName, Action <IReceiveEndpointConfigurator> configure)
        {
            if (string.IsNullOrWhiteSpace(topicPath))
            {
                throw new ArgumentNullException(nameof(topicPath));
            }
            if (configure == null)
            {
                throw new ArgumentNullException(nameof(configure));
            }

            var subscriptionPath = EntityNameHelper.FormatSubscriptionPath(topicPath, subscriptionName);

            return(_receivers.GetOrAdd(subscriptionPath, name =>
            {
                var topicConfigurator = new TopicConfigurator(topicPath, false);
                var settings = new SubscriptionEndpointSettings(topicConfigurator.GetTopicDescription(), subscriptionName);

                var endpointConfiguration = _hostConfiguration.CreateSubscriptionEndpointConfiguration(settings);

                var configurator = new SubscriptionBrokeredMessageReceiverConfiguration(_hostConfiguration, endpointConfiguration);

                configure(configurator);

                return configurator.Build();
            }));
        }
コード例 #2
0
        public ServiceBusMessagePublishTopology(IMessageTopology <TMessage> messageTopology)
        {
            _messageTopology = messageTopology;

            _topicDescription = new Lazy <TopicDescription>(GetTopicDescription);

            _topicConfigurator = new TopicConfigurator(messageTopology.EntityName, TypeMetadataCache <TMessage> .IsTemporaryMessageType);
        }
コード例 #3
0
        public AmazonSqsMessagePublishTopology(IMessageTopology <TMessage> messageTopology)
        {
            _messageTopology = messageTopology;

            var topicName = _messageTopology.EntityName;

            var temporary = TypeMetadataCache <TMessage> .IsTemporaryMessageType;

            var durable    = !temporary;
            var autoDelete = temporary;

            _topic = new TopicConfigurator(topicName, durable, autoDelete);
        }
コード例 #4
0
        public ActiveMqMessagePublishTopology(IActiveMqPublishTopology publishTopology, IMessageTopology <TMessage> messageTopology)
        {
            _messageTopology = messageTopology;

            var topicName = $"{publishTopology.VirtualTopicPrefix}{messageTopology.EntityName}";

            var temporary = TypeMetadataCache <TMessage> .IsTemporaryMessageType;

            var durable    = !temporary;
            var autoDelete = temporary;

            _topic = new TopicConfigurator(topicName, durable, autoDelete);

            _implementedMessageTypes = new List <IActiveMqMessagePublishTopology>();
        }
コード例 #5
0
ファイル: MessageReceiver.cs プロジェクト: yj7o5/MassTransit
        IBrokeredMessageReceiver CreateBrokeredMessageReceiver(string topicPath, string subscriptionName, Action <IReceiveEndpointConfigurator> configure)
        {
            if (string.IsNullOrWhiteSpace(topicPath))
            {
                throw new ArgumentNullException(nameof(topicPath));
            }
            if (configure == null)
            {
                throw new ArgumentNullException(nameof(configure));
            }

            var subscriptionPath = EntityNameHelper.FormatSubscriptionPath(topicPath, subscriptionName);

            return(_receivers.GetOrAdd(subscriptionPath, name =>
            {
                var topicConfigurator = new TopicConfigurator(topicPath, false);