Skip to content

Add single header propagation rule#2460

Merged
jeremydmiller merged 1 commit intomainfrom
2450-propagate-single-header
Apr 8, 2026
Merged

Add single header propagation rule#2460
jeremydmiller merged 1 commit intomainfrom
2450-propagate-single-header

Conversation

@jeremydmiller
Copy link
Copy Markdown
Member

Summary

  • Adds PropagateIncomingHeaderToOutgoing(string headerName) to IPolicies for the common case of forwarding a single named header from incoming to outgoing messages
  • Implements PropagateOneHeaderRule — an optimized single-header variant of PropagateHeadersRule that avoids the array allocation
  • Expands header propagation documentation with examples for single header, multiple headers, and custom IEnvelopeRule implementations
  • Adds cross-reference from the message bus docs to the header propagation page

Example usage:

opts.Policies.PropagateIncomingHeaderToOutgoing("x-on-behalf-of");

Closes #2450

Test plan

  • 4 new unit tests for PropagateOneHeaderRule (modify no-op, single header copy, missing header skip, null incoming envelope)
  • All 8 header propagation tests pass (4 existing + 4 new)

🤖 Generated with Claude Code

Add a convenience API and optimized rule for propagating a single named
header from incoming to outgoing messages. This avoids the array
allocation of PropagateIncomingHeadersToOutgoing for the common case
of forwarding just one header (e.g. "on-behalf-of" for audit trails).

- Add PropagateOneHeaderRule in IEnvelopeRule.cs
- Add PropagateIncomingHeaderToOutgoing to IPolicies and WolverineOptions
- Add tests in CoreTests for the single-header propagation
- Expand header-propagation.md with single header, custom rule examples
- Add cross-reference from message-bus.md to header-propagation.md

Closes #2450

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Pluggable policy to automatically relay headers to outgoing messages

1 participant