From f9e4e31064e01feef2bf53925998a6352c80a27f Mon Sep 17 00:00:00 2001 From: Laurence Gillian Date: Mon, 20 Jul 2026 08:18:37 +0100 Subject: [PATCH] feat(postgresql): surface resolved TransportSchemaName in queue diagnostics PostgresqlQueue did not override Endpoint.DescribeProperties(), so the resolved transport-queue schema was invisible in `wolverine describe` and endpoint diagnostics. Two hosts sharing one Postgres database must set an identical TransportSchemaName; if they diverge the queue tables live in different schemas and messages strand silently (no error, no dead-letter). Override DescribeProperties() to add the resolved schema so the value is observable. Visibility only - no cross-host mismatch assertion or throw. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../Transport/PostgresqlQueueTests.cs | 16 ++++++++++++++++ .../Transport/PostgresqlQueue.cs | 13 +++++++++++++ 2 files changed, 29 insertions(+) diff --git a/src/Persistence/PostgresqlTests/Transport/PostgresqlQueueTests.cs b/src/Persistence/PostgresqlTests/Transport/PostgresqlQueueTests.cs index a1df6cffd..a4ddef2d1 100644 --- a/src/Persistence/PostgresqlTests/Transport/PostgresqlQueueTests.cs +++ b/src/Persistence/PostgresqlTests/Transport/PostgresqlQueueTests.cs @@ -56,6 +56,22 @@ public void polling_interval_defaults_to_null() queue.PollingInterval.ShouldBeNull(); } + [Fact] + public void describe_properties_includes_the_resolved_transport_schema() + { + // Two hosts sharing one Postgres database must set an identical TransportSchemaName; + // if they diverge, messages strand silently. Surfacing the resolved schema in endpoint + // diagnostics (wolverine describe) is what makes such a mismatch observable. + theTransport.TransportSchemaName = "custom_queue_schema"; + + var queue = new PostgresqlQueue("one", theTransport); + + var properties = queue.DescribeProperties(); + + properties.ShouldContainKey(nameof(PostgresqlTransport.TransportSchemaName)); + properties[nameof(PostgresqlTransport.TransportSchemaName)].ShouldBe("custom_queue_schema"); + } + [Fact] public void short_queue_name_leaves_identifiers_untouched() { diff --git a/src/Persistence/Wolverine.Postgresql/Transport/PostgresqlQueue.cs b/src/Persistence/Wolverine.Postgresql/Transport/PostgresqlQueue.cs index 82cb2f9b0..8bcc013d4 100644 --- a/src/Persistence/Wolverine.Postgresql/Transport/PostgresqlQueue.cs +++ b/src/Persistence/Wolverine.Postgresql/Transport/PostgresqlQueue.cs @@ -183,6 +183,19 @@ public ValueTask PurgeAsync(ILogger logger) }); } + public override IDictionary DescribeProperties() + { + var dict = base.DescribeProperties(); + + // Surface the resolved transport-queue schema so `wolverine describe` / endpoint + // diagnostics make it visible. Two hosts sharing one Postgres database must set an + // identical TransportSchemaName; if they diverge the queue tables live in different + // schemas and messages strand silently. This is visibility only - no assertion here. + dict[nameof(PostgresqlTransport.TransportSchemaName)] = Parent.TransportSchemaName; + + return dict; + } + public async ValueTask> GetAttributesAsync() { var count = await CountAsync();