Interface IMessageBusBuilder
- Namespace
- AWS.Messaging.Configuration
- Assembly
- AWS.Messaging.dll
This builder interface is used to configure the AWS messaging framework, including adding publishers and subscribers.
public interface IMessageBusBuilder
Methods
AddAdditionalService(ServiceDescriptor)
Add additional services to the IMessageBusBuilder. This method is used for AWS.Messaging plugins to add services for messaging.
IMessageBusBuilder AddAdditionalService(ServiceDescriptor serviceDescriptor)
Parameters
serviceDescriptor
ServiceDescriptorThe service descriptor for the added service.
Returns
AddEventBridgePublisher<TMessage>(string?, string?, EventBridgePublishOptions?)
Adds an EventBridge Publisher to the framework which will handle publishing the defined message type to the specified EventBridge event bus name. If you are specifying a global endpoint ID via EventBridgePublishOptions, then you must also include the AWSSDK.Extensions.CrtIntegration package in your application.
IMessageBusBuilder AddEventBridgePublisher<TMessage>(string? eventBusName, string? messageTypeIdentifier = null, EventBridgePublishOptions? options = null)
Parameters
eventBusName
stringThe EventBridge event bus name or ARN where the message will be published. If the event bus name is null, a message-specific event bus must be set on the EventBridgeOptions when sending an event.
messageTypeIdentifier
stringThe language-agnostic message type identifier. If not specified, the .NET type will be used.
options
EventBridgePublishOptionsContains additional properties that can be set while configuring an EventBridge publisher
Returns
Type Parameters
TMessage
AddMessageHandler<THandler, TMessage>(string?)
Add a message handler for a given message type. The message handler contains the business logic of how to process a given message type.
IMessageBusBuilder AddMessageHandler<THandler, TMessage>(string? messageTypeIdentifier = null) where THandler : IMessageHandler<TMessage>
Parameters
messageTypeIdentifier
stringThe language-agnostic message type identifier. If not specified, the .NET type will be used.
Returns
Type Parameters
THandler
TMessage
AddMessageSource(string)
Adds a global message source to the message bus. This source will be added to the message envelope of all the messages sent through the framework.
IMessageBusBuilder AddMessageSource(string messageSource)
Parameters
messageSource
stringThe relative or absolute Uri to be used as a message source.
Returns
AddMessageSourceSuffix(string)
Appends a suffix to the message source that is either set using AddMessageSource(string) or computed by the framework in the absence of a user-defined source.
IMessageBusBuilder AddMessageSourceSuffix(string suffix)
Parameters
suffix
stringThe suffix to append to the message source.
Returns
AddSNSPublisher<TMessage>(string?, string?)
Adds an SNS Publisher to the framework which will handle publishing the defined message type to the specified SNS topic URL.
IMessageBusBuilder AddSNSPublisher<TMessage>(string? topicUrl, string? messageTypeIdentifier = null)
Parameters
topicUrl
stringThe SNS topic URL to publish the message to. If the topic URL is null, a message-specific topic URL must be set on the SNSOptions when publishing a message.
messageTypeIdentifier
stringThe language-agnostic message type identifier. If not specified, the .NET type will be used.
Returns
Type Parameters
TMessage
AddSQSPoller(string, Action<SQSMessagePollerOptions>?)
Adds an SQS queue to poll for messages.
IMessageBusBuilder AddSQSPoller(string queueUrl, Action<SQSMessagePollerOptions>? options = null)
Parameters
queueUrl
stringThe SQS queue to poll for messages.
options
Action<SQSMessagePollerOptions>Optional configuration for polling message from SQS.
Returns
AddSQSPublisher<TMessage>(string?, string?)
Adds an SQS Publisher to the framework which will handle publishing the defined message type to the specified SQS queues URL.
IMessageBusBuilder AddSQSPublisher<TMessage>(string? queueUrl, string? messageTypeIdentifier = null)
Parameters
queueUrl
stringThe SQS queue URL to publish the message to. If the queue URL is null, a message-specific queue URL must be specified on the SQSOptions when sending a message.
messageTypeIdentifier
stringThe language-agnostic message type identifier. If not specified, the .NET type will be used.
Returns
Type Parameters
TMessage
AddSerializationCallback(ISerializationCallback)
Adds a serialization callback that lets users inject their own metadata to incoming and outgoing messages.
IMessageBusBuilder AddSerializationCallback(ISerializationCallback serializationCallback)
Parameters
serializationCallback
ISerializationCallbackAn instance of ISerializationCallbackthat lets users inject their own metadata to incoming and outgoing messages.
Returns
ConfigureBackoffPolicy(Action<BackoffPolicyBuilder>)
Configures the backoff policy used by AWS.Messaging.Services.Backoff.BackoffHandler and its available options.
IMessageBusBuilder ConfigureBackoffPolicy(Action<BackoffPolicyBuilder> configure)
Parameters
configure
Action<BackoffPolicyBuilder>
Returns
ConfigurePollingControlToken(PollingControlToken)
Configures the PollingControlToken, which can be used to start and stop the SQS Message Poller.
IMessageBusBuilder ConfigurePollingControlToken(PollingControlToken pollingControlToken)
Parameters
pollingControlToken
PollingControlToken
Returns
ConfigureSerializationOptions(Action<SerializationOptions>)
Configures an instance of SerializationOptions to control the serialization/de-serialization logic for the application message.
IMessageBusBuilder ConfigureSerializationOptions(Action<SerializationOptions> options)
Parameters
options
Action<SerializationOptions>
Returns
EnableMessageContentLogging()
Enables the visibility of data messages in the logging framework, exception handling and other areas. If this is enabled, messages sent by this framework will be visible in plain text across the framework's components. This means any sensitive user data sent by this framework will be visible in logs, any exceptions thrown and others.
IMessageBusBuilder EnableMessageContentLogging()
Returns
LoadConfigurationFromSettings(IConfiguration)
Retrieve the Message Processing Framework section from IConfiguration and apply the Message bus configuration based on that section.
IMessageBusBuilder LoadConfigurationFromSettings(IConfiguration configuration)
Parameters
configuration
IConfiguration