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
Akka Persistence journal and snapshot store backed by MongoDB database.
4
13
5
14
> [!NOTE]
6
-
>
15
+
>
7
16
> The MongoDB operator to limit the number of documents in a query only accepts an integer while akka provides a long as maximum for the loading of events during the replay. Internally the long value is cast to an integer and if the value is higher than Int32.MaxValue, Int32.MaxValue is used. So if you have stored more than 2,147,483,647 events for a single PersistenceId, you may have a problem :wink:
8
17
9
18
## Setup
@@ -133,12 +142,12 @@ akka.persistence {
133
142
134
143
## Programmatic configuration
135
144
136
-
You can programmatically override the connection string setting in the HOCON configuration by adding a `MongoDbPersistenceSetup` to the
145
+
You can programmatically override the connection string setting in the HOCON configuration by adding a `MongoDbPersistenceSetup` to the
137
146
`ActorSystemSetup` during `ActorSystem` creation. The `MongoDbPersistenceSetup` takes `MongoClientSettings` instances to be used to configure
138
147
MongoDB client connection to the server. The `connection-string` settings in the HOCON configuration will be ignored if any of these `MongoClientSettings`
139
148
exists inside the Setup object.
140
149
141
-
> [!NOTE]
150
+
> [!NOTE]
142
151
> The HOCON configuration is still needed for this to work, only the `connection-string` setting in the configuration will be overriden.
143
152
144
153
Setting connection override for both snapshot store and journal:
@@ -215,9 +224,9 @@ Setting `legacy-serialization = on` will allow you to save objects in a BSON for
215
224
MongoDb limits the size of documents it can store to 16 megabytes. If you know you will need to store snapshots larger than 16 megabytes, you can use the `Akka.Persistence.MongoDb.Snapshot.MongoDbGridFSSnapshotStore` snapshot store plugin.
216
225
217
226
> [!NOTE]
218
-
>
227
+
>
219
228
> `MongoDbGridFSSnapshotStore` is not designed for normal snapshot store plugin, it does not support transaction and read/write operations are slower on this plugin. Only use this plugin if you are having 16 megabyte limit problem.
220
-
229
+
221
230
Note that `MongoDbGridFSSnapshotStore` is considered as advanced optional plugin and it will not get an `Akka.Hosting` support. You will need to use HOCON configuration to use this plugin.
222
231
223
232
## Configuring `MongoDbGridFSSnapshotStore`
@@ -226,4 +235,35 @@ You will need to override the `class` property of the snapshot store `mongodb` H
0 commit comments