Table of Contents

Interface IAwsSqsSubscriptionBuilder

Namespace
Excalibur.Dispatch.Transport.Aws
Assembly
Excalibur.Dispatch.Transport.AwsSqs.dll

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

configure Action<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 configure is null.

QueueUrl(string)

Sets the SQS queue URL to receive messages.

IAwsSqsSubscriptionBuilder QueueUrl(string queueUrl)

Parameters

queueUrl string

The SQS queue URL.

Returns

IAwsSqsSubscriptionBuilder

The builder for fluent chaining.

Exceptions

ArgumentException

Thrown when queueUrl is null, empty, or whitespace.

RawMessageDelivery(bool)

Enables or disables raw message delivery for this subscription.

IAwsSqsSubscriptionBuilder RawMessageDelivery(bool enable = true)

Parameters

enable bool

true to deliver raw messages; false to include SNS envelope.

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

topicArn string

The full SNS topic ARN.

Returns

IAwsSqsSubscriptionBuilder

The builder for fluent chaining.

Exceptions

ArgumentException

Thrown when topicArn is null, empty, or whitespace.