Interface IAwsSqsSubscriptionBuilder
Fluent builder interface for configuring an SNS-to-SQS subscription.
public interface IAwsSqsSubscriptionBuilder
- Extension Methods
Examples
sub.TopicArn("arn:aws:sns:us-east-1:123:orders")
.QueueUrl("https://sqs.us-east-1.amazonaws.com/123/orders")
.RawMessageDelivery(true)
.FilterPolicy(filter =>
{
filter.OnMessageAttributes()
.Attribute("priority").Equals("high");
});
Remarks
This interface follows the Microsoft-style fluent builder pattern.
All methods return this for method chaining.
Methods
FilterPolicy(Action<IAwsSqsFilterPolicyBuilder>)
Configures a filter policy for this subscription.
IAwsSqsSubscriptionBuilder FilterPolicy(Action<IAwsSqsFilterPolicyBuilder> configure)
Parameters
configureAction<IAwsSqsFilterPolicyBuilder>The filter policy configuration action.
Returns
- IAwsSqsSubscriptionBuilder
The builder for fluent chaining.
Remarks
Filter policies allow selective message delivery based on message attributes. Only messages matching the filter policy are delivered to the queue.
Exceptions
- ArgumentNullException
Thrown when
configureis null.
QueueUrl(string)
Sets the SQS queue URL to receive messages.
IAwsSqsSubscriptionBuilder QueueUrl(string queueUrl)
Parameters
queueUrlstringThe SQS queue URL.
Returns
- IAwsSqsSubscriptionBuilder
The builder for fluent chaining.
Exceptions
- ArgumentException
Thrown when
queueUrlis null, empty, or whitespace.
RawMessageDelivery(bool)
Enables or disables raw message delivery for this subscription.
IAwsSqsSubscriptionBuilder RawMessageDelivery(bool enable = true)
Parameters
Returns
- IAwsSqsSubscriptionBuilder
The builder for fluent chaining.
Remarks
This setting overrides the default from RawMessageDelivery(bool).
TopicArn(string)
Sets the SNS topic ARN to subscribe to.
IAwsSqsSubscriptionBuilder TopicArn(string topicArn)
Parameters
topicArnstringThe full SNS topic ARN.
Returns
- IAwsSqsSubscriptionBuilder
The builder for fluent chaining.
Exceptions
- ArgumentException
Thrown when
topicArnis null, empty, or whitespace.