Skip to content

Better handling for when AddAWSMessageBus is invoked multiple times? #152

@brendonparker

Description

@brendonparker

Describe the feature

When AddAWSMessageBus is invoked multiple times, previous IMessageConfiguration configurations are overwritten/lost. Specifically, the subscriber mappings.

https://github.com/awslabs/aws-dotnet-messaging/blob/main/src/AWS.Messaging/Configuration/MessageBusBuilder.cs#L311

Use Case

I'm attempting to register message handlers within various sub modules/assemblies, instead of needing to have the top most dependency responsible for all the registration.

Proposed Solution

Various ways this may be addressed...

Option 1: Merge in existing configuration (subscriber mappings) with new configuration on subsequent calls.
Option 2: A separate API for adding message handlers (separate from AddAWSMessageBus).
Option 3: Decide this is unsupported and make it more clear. Perhaps a runtime check to know if it has already been configured.

Other Information

No response

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

AWS.Messaging (or related) package versions

AWS.Messaging 0.9.1

Targeted .NET Platform

.NET 8

Operating System and version

AmazonLinux

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature-requestA feature should be added or improved.p2This is a standard priority issuequeued

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions