You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
0 commit comments