feat(mediator): prepare outbound Rebus composition - #828
Conversation
Co-authored-by: AndreaCuneo <5227688+AndreaCuneo@users.noreply.github.com>
Co-authored-by: AndreaCuneo <5227688+AndreaCuneo@users.noreply.github.com>
Co-authored-by: AndreaCuneo <5227688+AndreaCuneo@users.noreply.github.com>
Co-authored-by: AndreaCuneo <5227688+AndreaCuneo@users.noreply.github.com>
Co-authored-by: AndreaCuneo <5227688+AndreaCuneo@users.noreply.github.com>
Co-authored-by: AndreaCuneo <5227688+AndreaCuneo@users.noreply.github.com>
Co-authored-by: AndreaCuneo <5227688+AndreaCuneo@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Prepares the mediator/Rebus setup for outbound-only hosts (notably Azure Functions) by introducing a reusable outbound Rebus registration path, updating sample compositions to split “API host” vs “processor” responsibilities, and documenting one-way hosting constraints.
Changes:
- Add
ApplicationComposition.RegisterOutboundRebus(...)to register Rebus as a one-way outbound client with generated routing. - Update the sample to use outbound-only Rebus in the web host and introduce a separate
Ark.MediatorFramework.Sample.RebusProcessorexecutable for receiving/processing. - Add an Azure Functions isolated-worker sample host + update docs/task tracking for one-way Rebus hosting.
Reviewed changes
Copilot reviewed 25 out of 25 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/mediator-framework/Ark.Tools.MediatorFramework.AzureFunctions/ArkAzureFunctionsServiceCollectionExtensions.cs | Registers IHttpContextAccessor + a ClaimsPrincipal context provider for Functions DI/container integration. |
| samples/Ark.MediatorFramework.Sample/test/Ark.MediatorFramework.Sample.Tests/packages.lock.json | Updates lockfile to reflect new project reference/dependency graph. |
| samples/Ark.MediatorFramework.Sample/src/Ark.MediatorFramework.Sample.WebInterface/SampleComposition.cs | Switches web host Rebus setup to outbound-only registration and wires routing via the new endpoints facade. |
| samples/Ark.MediatorFramework.Sample/src/Ark.MediatorFramework.Sample.WebInterface/SampleBusHostedService.cs | Starts both the outbound web-host bus and a separate processor container/bus. |
| samples/Ark.MediatorFramework.Sample/src/Ark.MediatorFramework.Sample.WebInterface/packages.lock.json | Updates lockfile for added processor project reference. |
| samples/Ark.MediatorFramework.Sample/src/Ark.MediatorFramework.Sample.WebInterface/Ark.MediatorFramework.Sample.WebInterface.csproj | Removes direct Rebus mediator package ref and adds project reference to the new processor project. |
| samples/Ark.MediatorFramework.Sample/src/Ark.MediatorFramework.Sample.RebusProcessor/SampleRebusEndpoints.cs | New: exposes generated handler registration + routing configuration to hosts. |
| samples/Ark.MediatorFramework.Sample/src/Ark.MediatorFramework.Sample.RebusProcessor/RebusProcessorComposition.cs | New: builds the “full processor” container (receivers/handlers/outbox processor). |
| samples/Ark.MediatorFramework.Sample/src/Ark.MediatorFramework.Sample.RebusProcessor/Program.cs | New: runnable processor entrypoint for the sample. |
| samples/Ark.MediatorFramework.Sample/src/Ark.MediatorFramework.Sample.RebusProcessor/packages.lock.json | New: lockfile for processor project dependencies. |
| samples/Ark.MediatorFramework.Sample/src/Ark.MediatorFramework.Sample.RebusProcessor/Ark.MediatorFramework.Sample.RebusProcessor.csproj | New: processor project definition + analyzer wiring. |
| samples/Ark.MediatorFramework.Sample/src/Ark.MediatorFramework.Sample.AzureFunctions/Program.cs | New: Functions isolated-worker sample host that composes the app container and generated HTTP triggers. |
| samples/Ark.MediatorFramework.Sample/src/Ark.MediatorFramework.Sample.AzureFunctions/packages.lock.json | New: lockfile for Functions host dependencies. |
| samples/Ark.MediatorFramework.Sample/src/Ark.MediatorFramework.Sample.AzureFunctions/local.settings.json.example | New: example local settings for Functions Core Tools. |
| samples/Ark.MediatorFramework.Sample/src/Ark.MediatorFramework.Sample.AzureFunctions/host.json | New: configures empty route prefix so generated routes stay /api/v1/.... |
| samples/Ark.MediatorFramework.Sample/src/Ark.MediatorFramework.Sample.AzureFunctions/Ark.MediatorFramework.Sample.AzureFunctions.csproj | New: Functions host project definition. |
| samples/Ark.MediatorFramework.Sample/src/Ark.MediatorFramework.Sample.Application/GreetingHandlers.cs | Replaces SendLocal with routable Send for owned workflow messages. |
| samples/Ark.MediatorFramework.Sample/src/Ark.MediatorFramework.Sample.Application/ApplicationComposition.cs | Adds RegisterOutboundRebus(...) and allows optional external IGreetingStore injection. |
| samples/Ark.MediatorFramework.Sample/README.md | Documents the new Azure Functions host sample and local run instructions. |
| samples/Ark.MediatorFramework.Sample/Directory.Packages.props | Adds Functions-related package versions for the sample. |
| docs/mediator-framework/progress/tasks/README.md | Updates Azure Functions task tracking state/links. |
| docs/mediator-framework/progress/tasks/azure-functions/AZF-07-one-way-rebus.md | Marks AZD-08 as decided in acceptance checklist. |
| docs/mediator-framework/guide/rebus.md | Documents outbound-only host rules and switches example to IBus.Send. |
| Directory.Packages.props | Adds Microsoft.Azure.Functions.Worker.Sdk version centrally. |
| Ark.Tools.slnx | Adds the new sample processor and Functions host projects to the solution. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@copilot Fix the code for all comments in this review thread. Do not make changes beyond what is described in the linked review thread. Review the comments, they could be false positive. |
… in hosted service Co-authored-by: AndreaCuneo <5227688+AndreaCuneo@users.noreply.github.com>
Co-authored-by: AndreaCuneo <5227688+AndreaCuneo@users.noreply.github.com>
|
@copilot merge master changes |
…ion-task Co-authored-by: AndreaCuneo <5227688+AndreaCuneo@users.noreply.github.com>
|
@copilot fix ci error |
…containers Co-authored-by: AndreaCuneo <5227688+AndreaCuneo@users.noreply.github.com>
Fixed in the latest commit. The CI failure was Root cause: after splitting into two separate containers, each created its own Fix: create one shared |
Azure Functions hosts require outbound-only Rebus configuration without receivers, workers, or local request/reply semantics.
ApplicationComposition.RegisterOutboundRebus(...).SendLocalwith routableSendfor owned workflow messages.