JustSaying
  • Introduction
  • Getting Started
  • Messaging Configuration
    • Logging
    • Metrics
    • Naming Conventions
  • Subscriptions
    • Configuration
      • ForTopic
      • ForQueue
      • SqsReadConfiguration
      • Handler Registration and Resolution
    • SubscriptionGroups
      • Configuration
    • Middleware
      • Custom Middleware
    • Dead Letter Queues
    • Message Context
  • Publications
    • Configuration
  • How JustSaying Uses SQS/SNS
  • Interoperability
  • AWS IAM
  • Sample Application
Powered by GitBook
On this page

Was this helpful?

Edit on GitHub
  1. Subscriptions
  2. Configuration

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) ITopicNamingConvention and IQueueNamingConvention, applied to the message type T.

    • These conventions can be overridden on a case-by-case basis using WithName in the topic configuration.

  • A dead letter queue will be created, named after the queue name above with an _error suffix.

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 orderreadyevent and queue orderreadyevent

Further configuration options can be defined by passing a configuration lambda to the ForTopic method.

PreviousConfigurationNextForQueue

Last updated 2 years ago

Was this helpful?