MassTransit PostgreSQL transport interop#3203
Merged
Merged
Conversation
Add a database-backed transport (masstransit-postgresql) that interoperates
bidirectionally with MassTransit's PostgreSQL SQL transport by calling its
stored functions. Unlike NServiceBus, MassTransit's SQL transport is a
function-driven two-table model (transport.message + transport.message_delivery)
that owns and migrates its own schema, so this transport calls functions rather
than reading/writing a Weasel-modeled table (no IDatabase).
- Send via transport.send_message (bare message body in jsonb + envelope columns,
message_type urn:message:{ns}:{type}, content_type application/json); must
supply priority and sent_time (the function defaults them to NULL but the
message/message_delivery columns are NOT NULL).
- Lease receive via transport.fetch_messages (per-listener consumer_id + per-poll
lock_id); ack via delete_message, nack via unlock_message, tracked per envelope.
- Resolve the urn back to a Wolverine message type across loaded assemblies
(RegisterInteropMessageAssembly), falling back to the full Namespace.TypeName.
- Reply address falls back from response_address to source_address.
- AutoProvision (opt-in) calls create_queue_v2; reuses Wolverine's MassTransit
db:// URI conventions (IMassTransitInteropEndpoint).
Both directions green vs a real MassTransit 8.5.10 PostgreSQL host (in
wolverine-interop).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…rial) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This was referenced Jun 23, 2026
Closed
This was referenced Jul 9, 2026
This was referenced Jul 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds a database-backed Wolverine transport that interoperates bidirectionally with a MassTransit application using the PostgreSQL SQL transport. Third permutation of the database-backed transport interop plan, after #3198 (NSB/SQL Server) and #3201 (NSB/PostgreSQL).
How — different from NServiceBus
MassTransit's SQL transport is not a documented "write the table" contract. It's a function-driven, two-table model —
transport.message(the bare contract JSON inbody+ envelope fields as columns) andtransport.message_delivery(per-queue lease/retry rows) — that MassTransit owns and migrates itself. Somasstransit-postgresql(inWolverine.Postgresql) interoperates by calling MassTransit's stored functions rather than reading/writing a Weasel-modeled table (noIDatabase):transport.send_messagewith the bare message body (jsonb) + the envelope columns and theurn:message:{Namespace}:{TypeName}message type, content typeapplication/json. (Must supplypriorityandsent_time— the function defaults them to NULL but the underlying columns are NOT NULL.)transport.fetch_messages(queue, consumer_id, lock_id, lock_duration, count); ack viadelete_message, nack viaunlock_message, tracked per envelope by(message_delivery_id, lock_id).create_queue_v2for the queues Wolverine listens to.urnback to a Wolverine message type across loaded assemblies (RegisterInteropMessageAssembly), reusing Wolverine's MassTransitdb://URI conventions (IMassTransitInteropEndpoint). Reply address falls back fromresponse_addresstosource_address.Tests
InteropTestsWithMassTransitAndPostgresql) —masstransit_sends_message_to_wolverineandwolverine_sends_message_to_masstransit_that_then_responds, stable across repeated runs.dotnet build wolverine.slnx -c Releaseclean (0 warnings, 0 errors).Docs
docs/guide/durability/postgresql.md— MassTransit interoperability section.docs/tutorials/interop.md— MassTransit over database transports section.🤖 Generated with Claude Code