ForTopic
ForTopic<T>
Creates a topic for which there can be multiple queue subscriptions. This enables a 'fan out' scenario.
- A topic and queue pair will be created for message of type
T, with a subscription attaching the topic to the queue. - The topic and queue names will be determined using the supplied (or default if not)
ITopicNamingConventionandIQueueNamingConvention, applied to the message typeT.- These conventions can be overridden on a case-by-case basis using
WithNamein the topic configuration.
- These conventions can be overridden on a case-by-case basis using
- A dead letter queue will be created, named after the queue name above with an
_errorsuffix.
Example:
x.ForTopic<OrderReadyEvent>();
This describes the following infrastructure:
- An SQS queue of name
orderreadyevent - An SQS queue of name
orderreadyevent_error - An SNS topic of name
orderreadyevent - An SNS topic subscription on topic
orderreadyeventand queueorderreadyevent
Further configuration options can be defined by passing a configuration lambda to the ForTopic method.