From d7227aaecc4d2948fbac6a50ffd452ca3b4d00d8 Mon Sep 17 00:00:00 2001 From: lukedukeus Date: Tue, 19 Aug 2025 08:30:59 -0400 Subject: [PATCH] make constructors public --- .../SqsSubscription.cs | 59 ++++++++++--------- .../SqsSubscription.cs | 59 ++++++++++--------- 2 files changed, 60 insertions(+), 58 deletions(-) diff --git a/src/Paramore.Brighter.MessagingGateway.AWS.V4/SqsSubscription.cs b/src/Paramore.Brighter.MessagingGateway.AWS.V4/SqsSubscription.cs index e0a0e1e85d..af329d7fa8 100644 --- a/src/Paramore.Brighter.MessagingGateway.AWS.V4/SqsSubscription.cs +++ b/src/Paramore.Brighter.MessagingGateway.AWS.V4/SqsSubscription.cs @@ -40,7 +40,7 @@ public class SqsSubscription : Subscription /// The routing key type. /// public ChannelType ChannelType { get; } - + /// /// Indicates how we should treat the /// TopicFindBy.Arn -> the routing key is an Arn; assumes that you know it exists and provide it @@ -55,12 +55,12 @@ public class SqsSubscription : Subscription /// QueueFindBy.Name -> The Channel Name contains the name of the queue; we will look up the queue Url /// public QueueFindBy FindQueueBy { get; set; } - + /// /// The underlying definition. This is used to create the queue if it does not exist. /// public SqsAttributes QueueAttributes { get; } - + /// /// The attributes of the topic; used if the is /// @@ -90,7 +90,7 @@ public class SqsSubscription : Subscription /// What are the of the Sqs queue we use to receive messages /// What are the of the topic to which are queue subscribes, if we are /// Should we make channels if they don't exist, defaults to creating - protected SqsSubscription( + public SqsSubscription( SubscriptionName subscriptionName, ChannelName channelName, ChannelType channelType, @@ -118,16 +118,16 @@ protected SqsSubscription( { if (channelType == ChannelType.PubSub && routingKey is null) throw new ArgumentNullException(nameof(routingKey), "Routing Key is required for PubSub channels"); - + if (channelType == ChannelType.PointToPoint && channelName is null) throw new ArgumentNullException(nameof(channelName), "Channel Name is required for PointToPoint channels"); QueueAttributes = queueAttributes ?? SqsAttributes.Empty; TopicAttributes = topicAttributes ?? SnsAttributes.Empty; - - if (channelType == ChannelType.PubSub && QueueAttributes.Type != TopicAttributes.Type) - throw new InvalidOperationException(" For PubSub channels, you must set both queue and topic attribute to the same Type (default Standard)"); - + + if (channelType == ChannelType.PubSub && QueueAttributes.Type != TopicAttributes.Type) + throw new InvalidOperationException(" For PubSub channels, you must set both queue and topic attribute to the same Type (default Standard)"); + ChannelType = channelType; FindTopicBy = findTopicBy; FindQueueBy = findQueueBy; @@ -188,25 +188,26 @@ public SqsSubscription( SnsAttributes? topicAttributes = null, OnMissingChannel makeChannels = OnMissingChannel.Create) : base( - subscriptionName ?? new SubscriptionName(typeof(T).FullName!), - channelName ?? new ChannelName(typeof(T).FullName!), - channelType, - routingKey ?? new RoutingKey(typeof(T).FullName!), - typeof(T), - getRequestType, - bufferSize, + subscriptionName ?? new SubscriptionName(typeof(T).FullName!), + channelName ?? new ChannelName(typeof(T).FullName!), + channelType, + routingKey ?? new RoutingKey(typeof(T).FullName!), + typeof(T), + getRequestType, + bufferSize, noOfPerformers, - timeOut, - requeueCount, - requeueDelay, - unacceptableMessageLimit, - messagePumpType, - channelFactory, - emptyChannelDelay, - channelFailureDelay, - findTopicBy, - findQueueBy, - queueAttributes, - topicAttributes, - makeChannels) { } + timeOut, + requeueCount, + requeueDelay, + unacceptableMessageLimit, + messagePumpType, + channelFactory, + emptyChannelDelay, + channelFailureDelay, + findTopicBy, + findQueueBy, + queueAttributes, + topicAttributes, + makeChannels) + { } } diff --git a/src/Paramore.Brighter.MessagingGateway.AWSSQS/SqsSubscription.cs b/src/Paramore.Brighter.MessagingGateway.AWSSQS/SqsSubscription.cs index 9fec08304e..e2f4b8809a 100644 --- a/src/Paramore.Brighter.MessagingGateway.AWSSQS/SqsSubscription.cs +++ b/src/Paramore.Brighter.MessagingGateway.AWSSQS/SqsSubscription.cs @@ -40,7 +40,7 @@ public class SqsSubscription : Subscription /// The routing key type. /// public ChannelType ChannelType { get; } - + /// /// Indicates how we should treat the /// TopicFindBy.Arn -> the routing key is an Arn; assumes that you know it exists and provide it @@ -55,12 +55,12 @@ public class SqsSubscription : Subscription /// QueueFindBy.Name -> The Channel Name contains the name of the queue; we will look up the queue Url /// public QueueFindBy FindQueueBy { get; set; } - + /// /// The underlying definition. This is used to create the queue if it does not exist. /// public SqsAttributes QueueAttributes { get; } - + /// /// The attributes of the topic; used if the is /// @@ -90,7 +90,7 @@ public class SqsSubscription : Subscription /// What are the of the Sqs queue we use to receive messages /// What are the of the topic to which are queue subscribes, if we are /// Should we make channels if they don't exist, defaults to creating - protected SqsSubscription( + public SqsSubscription( SubscriptionName subscriptionName, ChannelName channelName, ChannelType channelType, @@ -118,16 +118,16 @@ protected SqsSubscription( { if (channelType == ChannelType.PubSub && routingKey is null) throw new ArgumentNullException(nameof(routingKey), "Routing Key is required for PubSub channels"); - + if (channelType == ChannelType.PointToPoint && channelName is null) throw new ArgumentNullException(nameof(channelName), "Channel Name is required for PointToPoint channels"); QueueAttributes = queueAttributes ?? SqsAttributes.Empty; TopicAttributes = topicAttributes ?? SnsAttributes.Empty; - - if (channelType == ChannelType.PubSub && QueueAttributes.Type != TopicAttributes.Type) - throw new InvalidOperationException(" For PubSub channels, you must set both queue and topic attribute to the same Type (default Standard)"); - + + if (channelType == ChannelType.PubSub && QueueAttributes.Type != TopicAttributes.Type) + throw new InvalidOperationException(" For PubSub channels, you must set both queue and topic attribute to the same Type (default Standard)"); + ChannelType = channelType; FindTopicBy = findTopicBy; FindQueueBy = findQueueBy; @@ -188,25 +188,26 @@ public SqsSubscription( SnsAttributes? topicAttributes = null, OnMissingChannel makeChannels = OnMissingChannel.Create) : base( - subscriptionName ?? new SubscriptionName(typeof(T).FullName!), - channelName ?? new ChannelName(typeof(T).FullName!), - channelType, - routingKey ?? new RoutingKey(typeof(T).FullName!), - typeof(T), - getRequestType, - bufferSize, - noOfPerformers, + subscriptionName ?? new SubscriptionName(typeof(T).FullName!), + channelName ?? new ChannelName(typeof(T).FullName!), + channelType, + routingKey ?? new RoutingKey(typeof(T).FullName!), + typeof(T), + getRequestType, + bufferSize, + noOfPerformers, timeOut, - requeueCount, - requeueDelay, - unacceptableMessageLimit, - messagePumpType, - channelFactory, - emptyChannelDelay, - channelFailureDelay, - findTopicBy, - findQueueBy, - queueAttributes, - topicAttributes, - makeChannels) { } + requeueCount, + requeueDelay, + unacceptableMessageLimit, + messagePumpType, + channelFactory, + emptyChannelDelay, + channelFailureDelay, + findTopicBy, + findQueueBy, + queueAttributes, + topicAttributes, + makeChannels) + { } }