/
policies.conf
executable file
·195 lines (166 loc) · 5.96 KB
/
policies.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
ditto {
mapping-strategy.implementation = "org.eclipse.ditto.services.models.policies.PoliciesMappingStrategies"
cluster-downing.role = "policies"
mongodb {
options {
ssl = false
ssl = ${?MONGO_DB_SSL_ENABLED}
w = 1
}
}
persistence.operations.delay-after-persistence-actor-shutdown = 5s
persistence.operations.delay-after-persistence-actor-shutdown = ${?DELAY_AFTER_PERSISTENCE_ACTOR_SHUTDOWN}
policies {
tags {
streaming-cache-size = 1000
streaming-cache-size = ${?TAGS_STREAMING_CACHE_SIZE}
}
policy {
activity-check {
# the interval of how long to keep an "inactive" Policy in memory:
inactive-interval = 2h
inactive-interval = ${?POLICY_ACTIVITY_CHECK_INTERVAL}
# the interval of how long to keep a deleted Policy in memory
deleted-interval = 5m
deleted-interval = ${?POLICY_ACTIVITY_CHECK_DELETED_INTERVAL}
}
# the interval to check for modifications and send out an event if modified:
modification-check {
interval = 10s
interval = ${?POLICY_MODIFICATION_CHECK_INTERVAL}
}
snapshot {
# the interval when to do snapshot for a Policy which had changes to it
interval = 15m
interval = ${?POLICY_SNAPSHOT_INTERVAL} # may be overridden with this environment variable
# the threshold after how many changes to a Policy to do a snapshot
threshold = 500
threshold = ${?POLICY_SNAPSHOT_THRESHOLD} # may be overridden with this environment variable
}
supervisor {
exponential-backoff {
min = 1s
max = 120s
random-factor = 1.0
corrupted-receive-timeout = 600s
}
}
}
}
}
akka {
cluster {
sharding {
role = "policies"
}
roles = [
"policies"
]
}
persistence {
journal.auto-start-journals = [
"akka-contrib-mongodb-persistence-policies-journal"
]
snapshot-store.auto-start-snapshot-stores = [
"akka-contrib-mongodb-persistence-policies-snapshots"
]
}
}
akka-contrib-mongodb-persistence-policies-journal {
class = "akka.contrib.persistence.mongodb.MongoJournal"
plugin-dispatcher = "policy-journal-persistence-dispatcher"
circuit-breaker {
max-failures = 5 # if an exception during persisting an event/snapshot occurs this often -- a successful write resets the counter
max-failures = ${?BREAKER_MAXTRIES}
call-timeout = 5s # MongoDB Timeouts causing the circuitBreaker to open
call-timeout = ${?BREAKER_TIMEOUT}
reset-timeout = 3s # after this time in "Open" state, the cicuitBreaker is "Half-opened" again
reset-timeout = ${?BREAKER_RESET}
}
overrides {
journal-collection = "policies_journal"
journal-index = "policies_journal_index"
realtime-collection = "policies_realtime"
metadata-collection = "policies_metadata"
}
event-adapters {
mongodbobject = "org.eclipse.ditto.services.policies.persistence.serializer.DefaultPolicyMongoEventAdapter"
}
event-adapter-bindings {
"org.eclipse.ditto.signals.events.policies.PolicyEvent" = mongodbobject
"org.bson.BsonValue" = mongodbobject
}
}
akka-contrib-mongodb-persistence-policies-snapshots {
class = "akka.contrib.persistence.mongodb.MongoSnapshots"
plugin-dispatcher = "policy-snaps-persistence-dispatcher"
circuit-breaker {
max-failures = 5 # if an exception during persisting an event/snapshot occurs this often -- a successful write resets the counter
max-failures = ${?SNAPSHOT_BREAKER_MAXTRIES}
call-timeout = 10s # MongoDB Timeouts causing the circuitBreaker to open
call-timeout = ${?SNAPSHOT_BREAKER_TIMEOUT}
reset-timeout = 6s # after this time in "Open" state, the cicuitBreaker is "Half-opened" again
reset-timeout = ${?SNAPSHOT_BREAKER_RESET}
}
overrides {
snaps-collection = "policies_snaps"
snaps-index = "policies_snaps_index"
}
}
policy-journal-persistence-dispatcher {
type = Dispatcher
# which mailbox to use
mailbox-type = "org.eclipse.ditto.services.policies.persistence.actors.PolicyPersistenceActorMailbox"
mailbox-capacity = 100
executor = "fork-join-executor"
fork-join-executor {
parallelism-min = 4
parallelism-factor = 3.0
parallelism-max = 32
parallelism-max = ${?DEFAULT_DISPATCHER_PARALLELISM_MAX}
}
throughput = 5
}
policy-snaps-persistence-dispatcher {
type = Dispatcher
# which mailbox to use
mailbox-type = "org.eclipse.ditto.services.policies.persistence.actors.PolicyPersistenceActorMailbox"
mailbox-capacity = 100
executor = "fork-join-executor"
fork-join-executor {
parallelism-min = 4
parallelism-factor = 3.0
parallelism-max = 32
parallelism-max = ${?DEFAULT_DISPATCHER_PARALLELISM_MAX}
}
throughput = 5
}
akka.contrib.persistence.mongodb.mongo {
suffix-builder {
separator = "@"
separator = ${?MONGO_COLLECTION_NAME_SUFFIX_SEPARATOR}
// set class="" to disable suffixing
class = "org.eclipse.ditto.services.utils.persistence.mongo.suffixes.NamespaceSuffixCollectionNames"
class = ${?MONGO_COLLECTION_NAME_SUFFIX_CLASS}
supported-prefixes = ["policy"]
}
suffix-drop-empty-collections = true
suffix-drop-empty-collections = ${?MONGO_COLLECTION_SUFFIX_DROP_EMPTY_COLLECTIONS}
collection-cache {
journal {
class = "org.eclipse.ditto.services.utils.persistence.mongo.DittoMongoCollectionCache"
expire-after-write = 1h // check each collection every hour whether it was created correctly
expire-after-write = ${?MONGO_COLLECTION_CACHE_JOURNAL_TTL}
max-size = 1000 // namespace collections cached per node
max-size = ${?MONGO_COLLECTION_CACHE_JOURNAL_MAX_SIZE}
}
snaps {
class = "org.eclipse.ditto.services.utils.persistence.mongo.DittoMongoCollectionCache"
expire-after-write = 1h
expire-after-write = ${?MONGO_COLLECTION_CACHE_SNAPS_TTL}
max-size = 1000
max-size = ${?MONGO_COLLECTION_CACHE_JOURNAL_MAX_SIZE}
}
}
}
include "policies-extension.conf"