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();