Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions src/Persistence/PostgresqlTests/Transport/PostgresqlQueueTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
{
Expand Down
13 changes: 13 additions & 0 deletions src/Persistence/Wolverine.Postgresql/Transport/PostgresqlQueue.cs
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,19 @@ public ValueTask PurgeAsync(ILogger logger)
});
}

public override IDictionary<string, object> 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<Dictionary<string, string>> GetAttributesAsync()
{
var count = await CountAsync();
Expand Down
Loading