/
gateway.conf
executable file
·230 lines (195 loc) · 6.5 KB
/
gateway.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
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
ditto {
mapping-strategy.implementation = "org.eclipse.ditto.services.gateway.starter.service.util.GatewayMappingStrategies"
cluster-downing.role = "gateway"
gateway {
http {
# InetAddress.getLocalHost.getHostAddress is used if empty
hostname = ""
hostname = ${?HOSTNAME}
hostname = ${?BIND_HOSTNAME}
port = 8080
port = ${?HTTP_PORT}
port = ${?PORT}
schema-versions = [1, 2]
# override schema-versions via system properties, e.g.: -Dditto.gateway.http.schema-versions.0=1 -Dditto.gateway.http.schema-versions.1=2
}
cluster {
# as a rule of thumb: should be factor ten of the amount of cluster nodes available
# be aware that it must be the same as for all other services (e.g. search-updater)
number-of-shards = 30
number-of-shards = ${?CLUSTER_NUMBER_OF_SHARDS}
}
websocket {
# the max queue size of how many inflight Commands a single Websocket client can have
subscriber.backpressure-queue-size = 100
subscriber.backpressure-queue-size = ${?WS_SUBSCRIBER_BACKPRESSURE}
# the max buffer size of how many outstanding CommandResponses and Events a single Websocket client can have
# additionally CommandResponses and Events are dropped if this size is reached
publisher.backpressure-buffer-size = 200
publisher.backpressure-buffer-size = ${?WS_PUBLISHER_BACKPRESSURE}
}
message {
default-timeout = 10s
max-timeout = 1m
}
claim-message {
default-timeout = 1m
max-timeout = 10m
}
dns {
# DNS server to use for looking up services
address = none
address = ${?DNS_SERVER} # may be overridden with this environment variable
}
authentication {
# configures HTTP for different authentication mechanisms: IM3, JWT (e.g. Google), ...
http {
# proxy config
proxy {
enabled = false
enabled = ${?AUTH_HTTP_PROXY_ENABLED}
host = ${?AUTH_HTTP_PROXY_HOST}
port = ${?AUTH_HTTP_PROXY_PORT}
username = ${?AUTH_HTTP_PROXY_USERNAME}
password = ${?AUTH_HTTP_PROXY_PASSWORD}
}
}
dummy {
# enable/disable dummy authentication (for dev purposes)
enabled = false
enabled = ${?ENABLE_DUMMY_AUTH}
}
}
health-check {
enabled = true
enabled = ${?HEALTH_CHECK_ENABLED} # may be overridden with this environment variable
interval = 60s
service.timeout = 10s
service.timeout = ${?HEALTH_CHECK_SERVICE_TIMEOUT} # may be overridden with this environment variable
cluster-roles = {
enabled = true
enabled = ${?HEALTH_CHECK_ROLES_ENABLED} # may be overridden with this environment variable
expected = [
"policies",
"things",
"things-search",
"gateway",
"connectivity",
"concierge"
]
}
}
devops {
securestatus = true
securestatus = ${?DEVOPS_SECURE_STATUS}
}
public-health {
cache-timeout = 20s
cache-timeout = ${?GATEWAY_STATUS_HEALTH_EXTERNAL_TIMEOUT}
}
metrics {
systemMetrics.enabled = true
systemMetrics.enabled = ${?SYSTEM_METRICS_ENABLED}
prometheus {
enabled = true
enabled = ${?PROMETHEUS_ENABLED}
hostname = 0.0.0.0
hostname = ${?PROMETHEUS_HOSTNAME}
port = 9095
port = ${?PROMETHEUS_PORT}
}
}
forcehttps = false
forcehttps = ${?FORCE_HTTPS}
enablecors = false
enablecors = ${?ENABLE_CORS}
redirect-to-https = false
redirect-to-https = ${?REDIRECT_TO_HTTPS}
redirect-to-https-blacklist-pattern = "/cr.*|/api.*|/ws.*|/status.*|/overall.*"
cache {
publickeys {
maxentries = 32
expiry = 60m
}
}
}
}
secrets {
devops_password = "foobar"
devops_password = ${?DEVOPS_PASSWORD}
}
akka {
actor {
deployment {
/gatewayRoot/proxy {
router = round-robin-pool
# nr-of-instances = 5
resizer {
lower-bound = 5
upper-bound = 100
messages-per-resize = 50
}
}
}
}
cluster {
sharding {
role = "gateway"
}
roles = [
"gateway"
]
}
http {
server {
server-header = "" # default: akka-http/${akka.http.version}
request-timeout = 60s # default: 20 s
request-timeout = ${?REQUEST_TIMEOUT}
idle-timeout = 610s # default: 60s
idle-timeout = ${?IDLE_TIMEOUT}
max-connections = 4096 # default: 1024
backlog = 100 # default: 100
raw-request-uri-header = on # default: off
parsing {
max-uri-length = 8k # default: 2k
# Default maximum content length which should not be exceeded by incoming request entities.
# is handled + checked additionally by Ditto code - just in order to prevent the "worst case" where the backend
# has to read a lot of data it won't process anyway, set a reasonable limit:
max-content-length = 1m # default: 8m
illegal-header-warnings = off # default: on
error-logging-verbosity = simple # default: full
}
websocket {
# could be also "pong" for unidirectional keepalives
periodic-keep-alive-mode = ping # default: ping
# Interval for sending periodic keep-alives
periodic-keep-alive-max-idle = 30s # default: infinite
}
termination-deadline-exceeded-response {
# Status code of the "terminating" response to be automatically sent to pending requests once the termination deadline is exceeded.
# default: 503
status = 502 # Bad Gateway
}
}
host-connection-pool {
# The maximum number of open requests accepted into the pool across all
# materializations of any of its client flows.
# Protects against (accidentally) overloading a single pool with too many client flow materializations.
# Note that with N concurrent materializations the max number of open request in the pool
# will never exceed N * max-connections * pipelining-limit.
# Must be a power of 2 and > 0!
max-open-requests = 1024 # default: 32
# The time after which an idle connection pool (without pending requests)
# will automatically terminate itself. Set to `infinite` to completely disable idle timeouts.
idle-timeout = 60s # default: 30s
}
}
}
blocking-dispatcher {
type = Dispatcher
executor = "thread-pool-executor"
thread-pool-executor {
fixed-pool-size = 8
}
throughput = 100
}