Skip to content

Message Middleware #218

Open
Open
@viniciuschiele

Description

@viniciuschiele

Describe the feature

It would be very helpful if aws-dotnet-messaging supported message middleware (or interceptors) that can be executed when sending or receiving messages to/from the broker. This middleware should allow custom logic to run before or after message publication and processing, similar to ASP.NET middleware or the pipeline in MediatR.

Middleware could be implemented as a chain or pipeline of delegates that operate on the message context, allowing users to perform cross-cutting concerns such as:

  • Logging
  • Message Enrichment
  • Retry logic

Note: Currently, implementing these behaviors is quite difficult because the library makes some of its core classes internal, such as SQSPublisher and EnvelopeSerializer, this limits the customization.

Use Case

  • Custom Retry Policies:
    Adding logic to retry messages under certain conditions, such as transient database exception.
  • Logging & Auditing:
    Logging message metadata or contents for auditing purposes, both on the producer and consumer sides.
  • Message Enrichment or Transformation:
    Modifying message headers before they are sent, or before they are processed.

Proposed Solution

No response

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.5

Targeted .NET Platform

All

Operating System and version

All

Metadata

Metadata

Assignees

Labels

feature-requestA feature should be added or improved.lEffort estimation: largep2This is a standard priority issue

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions