Skip to content

Commit

Permalink
make metadata index name configurable
Browse files Browse the repository at this point in the history
Signed-off-by: Aleksandar Stanchev <aleksandar.stanchev@bosch.io>
  • Loading branch information
Aleksandar Stanchev committed Aug 29, 2023
1 parent b821cdb commit 13ac59e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions scala/src/main/resources/reference.conf
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ pekko {
realtime-collection-size = 104857600 // 100MB

metadata-collection = "pekko_persistence_metadata"
metadata-index = "pekko_persistence_metadata_index"

use-legacy-serialization = false

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ abstract class MongoPersistenceDriver(as: ActorSystem, config: Config)
metadataCache.getOrElseCreate(metadataCollectionName, collectionName => {
val metadataCollection = ensureCollection(collectionName)
metadataCollection.flatMap(
ensureIndex("pekko_persistence_metadata_pid",
ensureIndex(metadataIndexName,
unique = true, sparse = true,
JournallingFieldNames.PROCESSOR_ID -> 1)(_)
)
Expand Down Expand Up @@ -327,6 +327,8 @@ abstract class MongoPersistenceDriver(as: ActorSystem, config: Config)

def metadataCollectionName: String = settings.MetadataCollection

def metadataIndexName: String = settings.MetadataIndex

def mongoUri: String = settings.MongoUri

def useLegacySerialization: Boolean = settings.UseLegacyJournalSerialization
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ class MongoSettings(val config: Config) {
val realtimeCollectionSize: Long = config.getLong("realtime-collection-size")

val MetadataCollection: String = config.getString("metadata-collection")
val MetadataIndex: String = config.getString("metadata-index")

val UseLegacyJournalSerialization: Boolean = config.getBoolean("use-legacy-serialization")

Expand Down

0 comments on commit 13ac59e

Please sign in to comment.