public static JustSayingFluentlyDependencies UsingQueueNameConvention( this JustSayingFluentlyDependencies dependencies, IQueueNamingConvention queueNamingConvention) { dependencies.QueueNamingConvention = queueNamingConvention; return(dependencies); }
/// <summary> /// Initializes a new instance of the <see cref="AccountAddressProvider"/> class with provided naming conventions. /// </summary> /// <param name="accountId">The AWS account ID the topics and queues belong in.</param> /// <param name="regionEndpoint">The AWS region the topics and queues belong in.</param> /// <param name="queueNamingConvention">A <see cref="IQueueNamingConvention"/> to use for producing a queue name from a message type.</param> /// <param name="topicNamingConvention">A <see cref="ITopicNamingConvention"/> to use for producing a topic name from a message type</param> public AccountAddressProvider(string accountId, RegionEndpoint regionEndpoint, IQueueNamingConvention queueNamingConvention, ITopicNamingConvention topicNamingConvention) { _accountId = accountId; _regionEndpoint = regionEndpoint; _queueNamingConvention = queueNamingConvention; _topicNamingConvention = topicNamingConvention; }
/// <summary> /// Initializes a new instance of the <see cref="AccountAddressProvider"/> class with the default naming convention. /// </summary> /// <param name="accountId">The AWS account ID the topics and queues belong in.</param> /// <param name="regionEndpoint">The AWS region the topics and queues belong in.</param> public AccountAddressProvider(string accountId, RegionEndpoint regionEndpoint) { _accountId = accountId; _regionEndpoint = regionEndpoint; var namingConventions = new DefaultNamingConventions(); _queueNamingConvention = namingConventions; _topicNamingConvention = namingConventions; }
/// <summary> /// Applies an <see cref="IQueueNamingConvention"/> to a type <see cref="T"/> and returns the result, with an optional override. /// </summary> /// <param name="namingConvention">An <see cref="IQueueNamingConvention"/> to apply to the T</param> /// <param name="overrideQueueName">An override that will be returned instead of the naming convention /// if the override is not null or whitespace.</param> /// <typeparam name="T">A type from which a queue name will be determined using the supplied <see cref="IQueueNamingConvention"/>.</typeparam> /// <returns>A string that is either the override if supplied, or the <see cref="IQueueNamingConvention"/> applied to the <see cref="T"/></returns> /// <exception cref="ArgumentNullException"> /// <paramref name="namingConvention"/> is <see langword="null"/>. /// </exception> public static string Apply <T>(this IQueueNamingConvention namingConvention, string overrideQueueName) { if (namingConvention == null) { throw new ArgumentNullException(nameof(namingConvention)); } return(string.IsNullOrWhiteSpace(overrideQueueName) ? namingConvention.QueueName <T>() : overrideQueueName); }
public NamespaceManager(IOptions <OpenMessageAzureProviderOptions <T> > options, IQueueNamingConvention queueNamingConvention, ITopicNamingConvention topicNamingConvention, ISubscriptionNamingConvention subscriptionNamingConvention, ILogger <NamespaceManager <T> > logger) { if (options == null) { throw new ArgumentNullException(nameof(options)); } if (queueNamingConvention == null) { throw new ArgumentNullException(nameof(queueNamingConvention)); } if (topicNamingConvention == null) { throw new ArgumentNullException(nameof(topicNamingConvention)); } if (subscriptionNamingConvention == null) { throw new ArgumentNullException(nameof(subscriptionNamingConvention)); } if (logger == null) { throw new ArgumentNullException(nameof(logger)); } if (string.IsNullOrWhiteSpace(options.Value?.ConnectionString)) { throw new ArgumentException($"The connection string has not been set for the type: {typeof(T).GetFriendlyName()}"); } _options = options.Value; _logger = logger; _queueNamingConvention = queueNamingConvention; _topicNamingConvention = topicNamingConvention; _subscriptionNamingConvention = subscriptionNamingConvention; }
public void ApplyQueueNamingConvention <T>(IQueueNamingConvention namingConvention) { QueueName = namingConvention.Apply <T>(QueueName); }
/// <summary> /// Specifies the <see cref="IQueueNamingConvention"/> to use. /// </summary> /// <param name="namingConvention">The <see cref="IQueueNamingConvention"/> to use.</param> /// <returns> /// The current <see cref="MessagingConfigurationBuilder"/>. /// </returns> /// <exception cref="ArgumentNullException"> /// <paramref name="namingConvention"/> is <see cref="null"/>. /// </exception> public MessagingConfigurationBuilder WithQueueNamingConvention(IQueueNamingConvention namingConvention) { QueueNamingConvention = namingConvention ?? throw new ArgumentNullException(nameof(namingConvention)); return(this); }
/// <summary> /// Initializes a new instance of the <see cref="AccountAddressProvider"/> class with provided naming conventions. /// </summary> /// <param name="accountId">The AWS account ID the topics and queues belong in.</param> /// <param name="regionName">The AWS region the topics and queues belong in.</param> /// <param name="queueNamingConvention">A <see cref="IQueueNamingConvention"/> to use for producing a queue name from a message type.</param> /// <param name="topicNamingConvention">A <see cref="ITopicNamingConvention"/> to use for producing a topic name from a message type</param> public AccountAddressProvider(string accountId, string regionName, IQueueNamingConvention queueNamingConvention, ITopicNamingConvention topicNamingConvention) : this(accountId, RegionEndpoint.GetBySystemName(regionName), queueNamingConvention, topicNamingConvention) { }