-
Notifications
You must be signed in to change notification settings - Fork 27
Subscriber middleware #274
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR implements subscriber middleware functionality for the AWS Messaging library, allowing users to add middleware components to the message processing pipeline. The middleware executes in the order of registration and can intercept, modify, or handle messages before they reach the message handlers.
Key changes:
- Added
IMiddlewareinterface and related infrastructure for middleware support - Modified
HandlerInvokerto execute middleware pipeline before message handlers - Enhanced configuration classes to register and manage middleware
Reviewed Changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 13 comments.
Show a summary per file
| File | Description |
|---|---|
src/AWS.Messaging/IMiddleware.cs |
Defines the middleware interface and request delegate |
src/AWS.Messaging/Services/HandlerInvoker.cs |
Implements middleware pipeline execution logic |
src/AWS.Messaging/Configuration/SubscriberMiddleware.cs |
Configuration class for tracking middleware types and lifetimes |
src/AWS.Messaging/Configuration/MessageBusBuilder.cs |
Adds middleware registration methods and DI setup |
src/AWS.Messaging/Configuration/SubscriberMapping.cs |
Enhanced to cache middleware method info for reflection |
test/AWS.Messaging.UnitTests/Models/SubscriberMiddlewareModels.cs |
Test models for middleware functionality |
test/AWS.Messaging.UnitTests/HandlerInvokerTests.cs |
Unit tests for middleware execution behavior |
sampleapps/SubscriberService/Middleware/SampleMiddleware.cs |
Sample middleware implementation |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
726da60 to
8f91ed8
Compare
|
Typos and documentation added as per copilot. Squashed and rebased on |
|
thanks for the PR! will take a look at it next week |
|
I have added a commit to introduce a Sample usage:
I am well aware that this is undiscussed functionality on an already undiscussed PR. While I have been using both implementations with success since April, I understand if one or both are a step to far. As such, I have left the two as distinct commits which can be squashed or removed as desired. One area that I suspect may be less than desirable in the later commit, is the caching of generic invocations for If Please let me know if you would like any changes to ease your comfort with the submission, alternatively please feel free to add/remove as you see fit or ignore it all together. |
f4b534d to
d9a500a
Compare
This is a partial implementation of the feature requested in #218 (limited to subscriber middleware)
The change modifies
HandlerInvokerto add middleware to the execution pipeline.I acknowledge that both the PR and implementation are unsolicited, and am happy to modify/withdraw as required.
Example usage:
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.