-
Couldn't load subscription status.
- Fork 22
feat(persistence): expose options in journal and snapshot builders #691
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Aaronontheweb
merged 1 commit into
akkadotnet:dev
from
Aaronontheweb:feature/builder-options-exposure
Oct 27, 2025
Merged
feat(persistence): expose options in journal and snapshot builders #691
Aaronontheweb
merged 1 commit into
akkadotnet:dev
from
Aaronontheweb:feature/builder-options-exposure
Oct 27, 2025
+269
−2
Conversation
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
Added Options property to AkkaPersistenceJournalBuilder and AkkaPersistenceSnapshotBuilder, allowing extension methods to access configuration details without requiring options as explicit parameters. This resolves the API design issue where connectivity check extensions and other plugin-specific methods needed options passed redundantly. Changes: - Added JournalOptions? Options property to AkkaPersistenceJournalBuilder - Added SnapshotOptions? Options property to AkkaPersistenceSnapshotBuilder - Added new constructors accepting options parameters - Updated WithJournal() and WithSnapshot() to pass options to builders - Maintained backward compatibility via nullable Options and legacy constructors - Added comprehensive test suite (BuilderOptionsAccessSpec) with 6 passing tests - Updated API approval baseline Resolves akkadotnet#690
|
LGTM |
Aaronontheweb
added a commit
to Aaronontheweb/Akka.Persistence.Azure
that referenced
this pull request
Oct 27, 2025
This commit updates Akka.Persistence.Azure to use the improved builder API from Akka.Hosting 1.5.55.1 (released via akkadotnet/Akka.Hosting#691). **Changes:** - Upgraded Akka.Hosting from 1.5.55 to 1.5.55.1 - Added simplified WithConnectivityCheck() overloads that access options from builder.Options - Kept original overloads with explicit options parameter for backward compatibility - Updated tests to use the new simplified API - Updated release notes to document the improved API **API Improvement:** The new API eliminates redundant parameter passing: Before (1.5.55): ```csharp journal.WithConnectivityCheck(journalOptions); ``` After (1.5.55.1): ```csharp journal.WithConnectivityCheck(); // Options accessed from builder automatically ``` All 9 connectivity check tests pass with the new API.
This was referenced Oct 27, 2025
Aaronontheweb
added a commit
to petabridge/Akka.Persistence.Azure
that referenced
this pull request
Oct 27, 2025
* Add connectivity health checks for Azure persistence backends Implements proactive connectivity health checks for both Azure Table Storage journal and Azure Blob Storage snapshot store, addressing akkadotnet/Akka.Hosting#678. Key additions: - AzureConnectivityCheckExtensions: WithConnectivityCheck() methods for journal and snapshot store builders - AzureTableJournalConnectivityCheck: Health check implementation using TableServiceClient.GetPropertiesAsync() - AzureBlobSnapshotStoreConnectivityCheck: Health check implementation using BlobServiceClient.GetPropertiesAsync() - Comprehensive test suite with 9 tests covering valid and invalid connection scenarios The implementation follows the same pattern as Redis, SQL, and MongoDB plugins, supporting all Azure SDK connection methods (connection string, ServiceUri + TokenCredential, and factory methods). Health checks are opt-in via .WithConnectivityCheck() and include proper tagging for filtering. Also upgrades Akka.NET and Akka.Hosting to 1.5.55 to utilize the new WithCustomHealthCheck API. * Update RELEASE_NOTES.md for v1.5.55 Add release notes documenting the new connectivity health check features and upgrade to Akka.NET/Akka.Hosting 1.5.55. * Upgrade to Akka.Hosting 1.5.55.1 with simplified connectivity check API This commit updates Akka.Persistence.Azure to use the improved builder API from Akka.Hosting 1.5.55.1 (released via akkadotnet/Akka.Hosting#691). **Changes:** - Upgraded Akka.Hosting from 1.5.55 to 1.5.55.1 - Added simplified WithConnectivityCheck() overloads that access options from builder.Options - Kept original overloads with explicit options parameter for backward compatibility - Updated tests to use the new simplified API - Updated release notes to document the improved API **API Improvement:** The new API eliminates redundant parameter passing: Before (1.5.55): ```csharp journal.WithConnectivityCheck(journalOptions); ``` After (1.5.55.1): ```csharp journal.WithConnectivityCheck(); // Options accessed from builder automatically ``` All 9 connectivity check tests pass with the new API. * Add comprehensive health check documentation Updated RELEASE_NOTES.md and README.md to document the new connectivity health check feature introduced in v1.5.55. **RELEASE_NOTES.md Changes:** - Updated Akka.Hosting version reference from 1.5.55 to 1.5.55.1 - Added "Improved API" section explaining simplified connectivity check API - Updated usage example to show new parameterless WithConnectivityCheck() method - Added backward compatibility note **README.md Changes:** - Expanded Health Checks section with two subsections: - Standard Health Checks: existing WithHealthCheck() functionality - Connectivity Health Checks: new WithConnectivityCheck() functionality - Added usage examples showing both individual and combined health check usage - Documented support for all Azure SDK connection methods - Included code examples demonstrating the simplified Akka.Hosting 1.5.55.1 API The connectivity checks are proactive health checks that verify backend connectivity regardless of recent operation activity, helping detect database outages during idle periods. * Fix Azure client creation priority order in connectivity checks Fixed critical bug where health check client creation used incorrect priority order (Factory > ConnectionString > Credential) instead of the correct order (Factory > Credential > ConnectionString). **Changes:** 1. Added `CreateTableServiceClient()` to `AzureTableStorageJournalSettings` - Centralizes client creation logic - Documents priority order: Factory > ServiceUri+Credential > ConnectionString - Eliminates code duplication 2. Added `CreateBlobServiceClient()` to `AzureBlobSnapshotStoreSettings` - Centralizes client creation logic - Documents priority order: Factory > ServiceUri+Credential > ConnectionString - Eliminates code duplication 3. Fixed `AzureTableJournalConnectivityCheck` - Corrected priority order to match core journal implementation - Added comment documenting correct order 4. Fixed `AzureBlobSnapshotStoreConnectivityCheck` - Corrected priority order to match core snapshot store implementation - Added comment documenting correct order **Impact:** This fixes potential issues where users configure both ConnectionString and ServiceUri+Credential - previously health checks would use ConnectionString while the actual plugins would use ServiceUri+Credential, leading to health checks testing the wrong backend. All 9 connectivity check tests pass with corrected priority order. * Fix health check test expectations for correct key casing Updated test assertions in AzurePersistenceHealthCheckSpec to match the actual health check keys used by Akka.Hosting: - Changed "Akka.Persistence.Journal.azure-table" to "akka.persistence.journal.azure-table" - Changed "Akka.Persistence.SnapshotStore.azure-blob-store" to "akka.persistence.snapshot-store.azure-blob-store" The health check keys are generated by the Akka.Hosting framework using lowercase HOCON-style paths. Test expectations were using incorrect Pascal case and inconsistent naming ("SnapshotStore" vs "snapshot-store"). * Approve new public API surface for connectivity health checks Updated API approval snapshots to include new public APIs: - AzureBlobSnapshotStoreConnectivityCheck class - AzureTableJournalConnectivityCheck class - AzureConnectivityCheckExtensions class with WithConnectivityCheck extension methods - CreateBlobServiceClient() factory method in AzureBlobSnapshotStoreSettings - CreateTableServiceClient() factory method in AzureTableStorageJournalSettings These additions provide proactive connectivity health checks for Azure persistence backends and centralize client creation logic to eliminate code duplication.
This was referenced Oct 28, 2025
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.
Summary
This PR exposes the
JournalOptionsandSnapshotOptionsinstances in their respective builder classes, eliminating the need for plugin extension methods to require options as explicit parameters.Changes
JournalOptions? Optionsproperty toAkkaPersistenceJournalBuilderSnapshotOptions? Optionsproperty toAkkaPersistenceSnapshotBuilderWithJournal()andWithSnapshot()methods to pass options to buildersOptionsand legacy constructorsProblem Solved
Previously, connectivity check extensions and other plugin-specific methods needed to accept options redundantly:
After this fix:
Testing
BuilderOptionsAccessSpec) with 6 tests covering:WithJournalAndSnapshotWithInMemoryJournal)Backward Compatibility
✅ Fully backward compatible:
Optionsproperty is nullable for legacy usageRelated Issues
Resolves #690