示例#1
0
        public Uri GetDestinationAddress(string topicName, Action <ITopicConfigurator> configure = null)
        {
            var sendSettings = new TopicPublishSettings(topicName, true, false);

            configure?.Invoke(sendSettings);

            return(sendSettings.GetSendAddress(_hostAddress));
        }
示例#2
0
        public Uri GetDestinationAddress(string topicName, Action <ITopicConfigurator> configure = null)
        {
            var address = new AmazonSqsEndpointAddress(_hostConfiguration.HostAddress, new Uri($"topic:{topicName}"));

            var publishSettings = new TopicPublishSettings(address);

            configure?.Invoke(publishSettings);

            return(publishSettings.GetSendAddress(_hostConfiguration.HostAddress));
        }
示例#3
0
        public Uri GetDestinationAddress(Type messageType, Action <ITopicConfigurator> configure = null)
        {
            var topicName   = _messageNameFormatter.GetMessageName(messageType).ToString();
            var isTemporary = TypeMetadataCache.IsTemporaryMessageType(messageType);
            var address     = new AmazonSqsEndpointAddress(_hostConfiguration.HostAddress, new Uri($"topic:{topicName}?temporary={isTemporary}"));

            var publishSettings = new TopicPublishSettings(address);

            configure?.Invoke(publishSettings);

            return(publishSettings.GetSendAddress(_hostConfiguration.HostAddress));
        }
示例#4
0
        public Uri GetDestinationAddress(Type messageType, Action <ITopicConfigurator> configure = null)
        {
            var isTemporary = TypeMetadataCache.IsTemporaryMessageType(messageType);

            var durable    = !isTemporary;
            var autoDelete = isTemporary;

            var name = _messageNameFormatter.GetMessageName(messageType).ToString();

            var settings = new TopicPublishSettings(name, durable, autoDelete);

            configure?.Invoke(settings);

            return(settings.GetSendAddress(_hostAddress));
        }