Skip to content

Fix unique SubjectUri for ancillary Marten stores (#2337)#2355

Merged
jeremydmiller merged 1 commit intoJasperFx:mainfrom
erdtsieck:feature/fix-ancillary-store-subject-uri-uniqueness
Mar 25, 2026
Merged

Fix unique SubjectUri for ancillary Marten stores (#2337)#2355
jeremydmiller merged 1 commit intoJasperFx:mainfrom
erdtsieck:feature/fix-ancillary-store-subject-uri-uniqueness

Conversation

@erdtsieck
Copy link
Copy Markdown
Contributor

Each ancillary store registered via AddMartenStore().IntegrateWithWolverine() was assigned the same default SubjectUri ("wolverine://messages"), making it impossible for JasperFx to generate separate database schemas per store when multiple ancillary stores live in the same assembly.

Fix: assign "wolverine://messages/{typeof(T).Name.ToLowerInvariant()}" as the SubjectUri in BuildSinglePostgresqlMessageStore and BuildMultiTenantedMessageDatabase, so every store gets a unique identifier.

Adds regression test ancillary_store_subject_uri_uniqueness that registers a primary store plus two ancillary stores and asserts all three SubjectUris are distinct.

Each ancillary store registered via AddMartenStore<T>().IntegrateWithWolverine()
was assigned the same default SubjectUri ("wolverine://messages"), making it
impossible for JasperFx to generate separate database schemas per store when
multiple ancillary stores live in the same assembly.

Fix: assign "wolverine://messages/{typeof(T).Name.ToLowerInvariant()}" as the
SubjectUri in BuildSinglePostgresqlMessageStore<T> and
BuildMultiTenantedMessageDatabase<T>, so every store gets a unique identifier.

Adds regression test ancillary_store_subject_uri_uniqueness that registers a
primary store plus two ancillary stores and asserts all three SubjectUris are
distinct.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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