@@ -50,7 +50,9 @@ class PostgresReadJournal(config: Config, configPath: String)(implicit val syste
50
50
val readJournalConfig = new ReadJournalConfig (config)
51
51
52
52
private val writePluginId = config.getString(" write-plugin" )
53
- private val eventAdapters = Persistence (system).adaptersFor(writePluginId)
53
+ // If 'config' is empty, or if the plugin reference is not found, then the write plugin will be resolved from the
54
+ // ActorSystem configuration. Otherwise, it will be resolved from the provided 'config'.
55
+ private val eventAdapters = Persistence (system).adaptersFor(writePluginId, config)
54
56
55
57
val readJournalDao : ReadJournalDao = {
56
58
val slickDb = SlickExtension (system).database(config)
@@ -294,10 +296,13 @@ class PostgresReadJournal(config: Config, configPath: String)(implicit val syste
294
296
.mapConcat(identity)
295
297
}
296
298
297
- def currentEventsByTag (tag : String , offset : Long ): Source [EventEnvelope , NotUsed ] =
298
- Source .future(readJournalDao.maxJournalSequence()).flatMapConcat { maxOrderingInDb =>
299
- eventsByTag(tag, offset, terminateAfterOffset = Some (maxOrderingInDb))
300
- }
299
+ def currentEventsByTag (tag : String , offset : Long ): Source [EventEnvelope , NotUsed ] = {
300
+ Source
301
+ .futureSource(readJournalDao.maxJournalSequence().map { maxOrderingInDb =>
302
+ eventsByTag(tag, offset, terminateAfterOffset = Some (maxOrderingInDb))
303
+ })
304
+ .mapMaterializedValue(_ => NotUsed )
305
+ }
301
306
302
307
/**
303
308
* Query events that have a specific tag.
0 commit comments