Skip to content

Copy Envelope.Headers to MassTransitEnvelope on write path#2439

Merged
jeremydmiller merged 1 commit intoJasperFx:mainfrom
outofrange-consulting:feature/masstransit-headers-both-ways
Apr 6, 2026
Merged

Copy Envelope.Headers to MassTransitEnvelope on write path#2439
jeremydmiller merged 1 commit intoJasperFx:mainfrom
outofrange-consulting:feature/masstransit-headers-both-ways

Conversation

@outofrange-consulting
Copy link
Copy Markdown

@outofrange-consulting outofrange-consulting commented Apr 5, 2026

Summary

  • The MassTransitEnvelope<T> constructor transfers message ID, correlation ID, conversation ID, and expiration time from a Wolverine Envelope, but not custom headers.
  • TransferData() already handles the reverse direction (MassTransit → Wolverine), so header mapping was one-way only.
  • This adds header copying in the constructor so headers flow both ways.

⚠️ Review note

@jeremydmiller — This change copies all Envelope.Headers into the outbound MassTransit envelope. This could potentially include headers that are Wolverine-internal and not intended for external consumers. Only E2E / integration tests with actual MassTransit consumers can confirm whether any unwanted headers leak through. Would appreciate your review to validate this is safe.

Test plan

  • Extended existing create_masstransit_envelope_from_envelope test to verify headers are copied
  • All 7 MassTransitEnvelopeTests pass
  • E2E validation with a MassTransit consumer to confirm no unwanted headers are exposed

🤖 Generated with Claude Code

…structor

Headers were only transferred from MassTransit to Wolverine (via TransferData),
but not the other way. Copy envelope headers in the constructor so they get
serialized outbound.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@jeremydmiller
Copy link
Copy Markdown
Member

@outofrange-consulting Huh, big miss, glad you filled that in. This will be in the next Wolverine coming up soon

@jeremydmiller jeremydmiller merged commit 4cc0e05 into JasperFx:main Apr 6, 2026
17 of 19 checks passed
@outofrange-consulting outofrange-consulting deleted the feature/masstransit-headers-both-ways branch April 6, 2026 13:20
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.

2 participants