Skip to content

Commit f7ca2ab

Browse files
committed
Fix event adapter callback API not invoking adapters at runtime
Fixed a critical bug where event adapters configured via the NEW callback API (journalBuilder callback parameter in WithJournal/WithJournalAndSnapshot) were not being invoked at runtime, despite being correctly present in HOCON configuration. Root Cause: AkkaPersistenceJournalBuilder.Build() was creating a Config with .WithFallback(Persistence.DefaultConfig()) which interfered with the main journal configuration during HOCON merging, causing adapters to be registered but not invoked. The Fix: Removed the unnecessary .WithFallback(Persistence.DefaultConfig()) call in AkkaPersistenceHostingExtensions.cs line 130. The adapter configuration blocks (event-adapters and event-adapter-bindings) don't require fallback to default persistence config and merge correctly with the journal config without it. Impact: This bug affected users with: - Multiple journal configurations (e.g., default + sharding) - NEW callback API: journalBuilder: journal => journal.AddWriteEventAdapter<...>() - Explicit JournalOptions + WithJournalAndSnapshot pattern This fix is especially critical now that the old Adapters property has been deprecated in #665. All users must use the callback API which was broken. Testing: - Added comprehensive regression test suite (EventAdapterRuntimeInvocationSpecs.cs) - Tests verify adapter runtime invocation with various configuration patterns - All 20 Akka.Persistence.Hosting.Tests pass - Verified backwards compatibility with existing EventAdapterSpecs Related Issues: - Fixes runtime invocation issue reported in akkadotnet/Akka.Persistence.Sql#552 - Critical fix for #665 callback API requirement
1 parent d716471 commit f7ca2ab

File tree

2 files changed

+544
-2
lines changed

2 files changed

+544
-2
lines changed

0 commit comments

Comments
 (0)