[英]Akka.Net PersistenceQuery not returning all results
I am using Akka.Net (v 1.3.2) and am trying to query the event journal for all events with a specific tag. 我正在使用Akka.Net(v 1.3.2),并试图在事件日志中查询具有特定标记的所有事件。 I only want the events that exist at the time I query the journal.
我只想查询期刊时存在的事件。 Inside an actor, I have the following code:
在演员内部,我有以下代码:
var readJournal = PersistenceQuery.Get(Context.System).ReadJournalFor<SqlReadJournal>(SqlReadJournal.Identifier);
var stream = readJournal.CurrentEventsByTag("The Tag Name", Offset.NoOffset());
var materializer = ActorMaterializer.Create(Context.System);
stream.RunForeach(envelope =>
{
// Do some stuff with the EventEnvelope
}, materializer).Wait();
This will successfully query the event journal. 这将成功查询事件日志。 However, the problem is it will only return the first 100 events.
但是,问题在于它只会返回前100个事件。 I need all of them that match the query!
我需要所有与查询匹配的东西!
Question: How do I remove the limit/filter that exists when querying the event journal by tag name? 问题:如何删除通过标签名称查询事件日志时存在的限制/过滤器?
If you need it, here is my akka.persistence configuration: 如果需要,这是我的akka.persistence配置:
var config = Akka.Configuration.ConfigurationFactory.ParseString(@"
akka.persistence {
journal {
plugin = ""akka.persistence.journal.sql-server""
sql-server {
class = ""Akka.Persistence.SqlServer.Journal.SqlServerJournal, Akka.Persistence.SqlServer""
connection-string = """ + connectionString + @"""
schema-name = dbo
table-name = __akka_EventJournal
metadata-table-name = __akka_Metadata
auto-initialize = on
}
}
snapshot-store {
plugin = ""akka.persistence.snapshot-store.sql-server""
sql-server {
class = ""Akka.Persistence.SqlServer.Snapshot.SqlServerSnapshotStore, Akka.Persistence.SqlServer""
connection-string = """ + connectionString + @"""
schema-name = dbo
table-name = __akka_SnapshotStore
auto-initialize = on
}
}
}"
);
There are two things to check out: 有两件事要检查:
akka.persistence.query.journal.sql.max-buffer-size
value (see: reference.conf ). akka.persistence.query.journal.sql.max-buffer-size
值(请参阅: reference.conf )来设置在一个查询中返回的最大消息数。 readJournal.EventsByTag
instead of readJournal.CurrentEventsByTag
to get a continuous stream of events. readJournal.EventsByTag
而不是readJournal.CurrentEventsByTag
来获取连续的事件流。 Just keep in mind, that it won't complete by itself, but will live on waiting for new events to arrive.
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.