-
Notifications
You must be signed in to change notification settings - Fork 325
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use ElasticMQ instead of fake_sqs (#3750)
* local-setup: Use ElasticMQ instead of fake_sqs for speed * chrats/fake-aws-sqs: Use ElasticMQ * CI Setup: Create SQS queues using config Not sure why we created the script, perhaps people didn't know about existence of this config value. * SQSWatcher: Use smaller wait time ElasticMQ allows max 20 seconds. * SQSWatcher: Ensure thread being killed is flagged properly * SQSWatcher: Use 5 concurrent loops to increase throughput Each recieve takes 300ms. When 16 tests run in parallel, this poor thread cannot keep up and causes timeouts. Instead of increasing the timeout increasing threads will ensure tests don't fail. * brig-integration: Use the queue name for SQSWatcher Galley uses the queue name, brig was using the queue-url, this is not correct. With the old fake-sqs implementation it still worked.
- Loading branch information
1 parent
2c657ce
commit a987fc5
Showing
16 changed files
with
255 additions
and
110 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
* Replace fake-sqs with ElasticMQ | ||
|
||
ElasticMQ is an actively maintained project, fake-sqs hasn't seen a commit since | ||
2018. This is not expected to have any noticeable effect on deployments that | ||
don't have any extra configurations for the SQS queues. If the fake-aws-sqs | ||
chart had configured custom queue names, they have couple of extra limitations: | ||
- The queue names must only contain alphanumeric characters and hyphens. | ||
- The FIFO queue names must end in `.fifo`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: {{ template "fullname" . }} | ||
labels: | ||
app: {{ template "fullname" . }} | ||
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" | ||
release: "{{ .Release.Name }}" | ||
heritage: "{{ .Release.Service }}" | ||
data: | ||
elasticmq.conf: | | ||
include classpath("application.conf") | ||
# What is the outside visible address of this ElasticMQ node | ||
# Used to create the queue URL (may be different from bind address!) | ||
node-address { | ||
protocol = http | ||
host = localhost | ||
port = {{ .Values.service.httpPort }} | ||
context-path = "" | ||
} | ||
rest-sqs { | ||
enabled = true | ||
bind-port = {{ .Values.service.httpPort }} | ||
bind-hostname = "0.0.0.0" | ||
# Possible values: relaxed, strict | ||
sqs-limits = strict | ||
} | ||
rest-stats { | ||
enabled = true | ||
bind-port = 9325 | ||
bind-hostname = "0.0.0.0" | ||
} | ||
# Should the node-address be generated from the bind port/hostname | ||
# Set this to true e.g. when assigning port automatically by using port 0. | ||
generate-node-address = false | ||
queues { | ||
{{- range $i, $queueName := .Values.queueNames }} | ||
"{{ $queueName }}" { | ||
{{- if hasSuffix ".fifo" $queueName }} | ||
fifo = true | ||
{{- end }} | ||
} | ||
{{- end }} | ||
} | ||
messages-storage { | ||
enabled = true | ||
uri = "jdbc:h2:/data/elasticmq.db" | ||
} | ||
# Region and accountId which will be included in resource ids | ||
aws { | ||
region = eu-west-1 | ||
accountId = 000000000000 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
include classpath("application.conf") | ||
|
||
# What is the outside visible address of this ElasticMQ node | ||
# Used to create the queue URL (may be different from bind address!) | ||
node-address { | ||
protocol = http | ||
host = localhost | ||
port = 4568 | ||
context-path = "" | ||
} | ||
|
||
rest-sqs { | ||
enabled = true | ||
bind-port = 4568 | ||
bind-hostname = "0.0.0.0" | ||
# Possible values: relaxed, strict | ||
sqs-limits = strict | ||
} | ||
|
||
rest-stats { | ||
enabled = true | ||
bind-port = 9325 | ||
bind-hostname = "0.0.0.0" | ||
} | ||
|
||
# Should the node-address be generated from the bind port/hostname | ||
# Set this to true e.g. when assigning port automatically by using port 0. | ||
generate-node-address = false | ||
|
||
queues { | ||
default-queue-template { | ||
defaultVisibilityTimeout = 1s | ||
} | ||
|
||
fifo-queue-template { | ||
defaultVisibilityTimeout = 1s | ||
fifo = true | ||
} | ||
|
||
integration-brig-events = ${queues.default-queue-template} | ||
integration-brig-events2 = ${queues.default-queue-template} | ||
integration-brig-events3 = ${queues.default-queue-template} | ||
integration-brig-events4 = ${queues.default-queue-template} | ||
integration-brig-events5 = ${queues.default-queue-template} | ||
integration-brig-events-federation-v0 = ${queues.default-queue-template} | ||
|
||
integration-brig-events-internal = ${queues.default-queue-template} | ||
integration-brig-events-internal2 = ${queues.default-queue-template} | ||
integration-brig-events-internal3 = ${queues.default-queue-template} | ||
integration-brig-events-internal4 = ${queues.default-queue-template} | ||
integration-brig-events-internal5 = ${queues.default-queue-template} | ||
integration-brig-events-internal-federation-v0 = ${queues.default-queue-template} | ||
|
||
"integration-user-events.fifo" = ${queues.fifo-queue-template} | ||
"integration-user-events2.fifo" = ${queues.fifo-queue-template} | ||
"integration-user-events3.fifo" = ${queues.fifo-queue-template} | ||
"integration-user-events4.fifo" = ${queues.fifo-queue-template} | ||
"integration-user-events5.fifo" = ${queues.fifo-queue-template} | ||
"integration-user-events-federation-v0.fifo" = ${queues.fifo-queue-template} | ||
|
||
integration-gundeck-events = ${queues.default-queue-template} | ||
integration-gundeck-events2 = ${queues.default-queue-template} | ||
integration-gundeck-events3 = ${queues.default-queue-template} | ||
integration-gundeck-events4 = ${queues.default-queue-template} | ||
integration-gundeck-events5 = ${queues.default-queue-template} | ||
integration-gundeck-events-federation-v0 = ${queues.default-queue-template} | ||
|
||
"integration-team-events.fifo" = ${queues.fifo-queue-template} | ||
"integration-team-events2.fifo" = ${queues.fifo-queue-template} | ||
"integration-team-events3.fifo" = ${queues.fifo-queue-template} | ||
"integration-team-events4.fifo" = ${queues.fifo-queue-template} | ||
"integration-team-events5.fifo" = ${queues.fifo-queue-template} | ||
"integration-team-events-federation-v0.fifo" = ${queues.fifo-queue-template} | ||
} | ||
|
||
# Region and accountId which will be included in resource ids | ||
aws { | ||
region = eu-west-1 | ||
accountId = 000000000000 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,36 @@ | ||
fake-aws-ses: | ||
enabled: true | ||
sesSender: "[email protected]" | ||
|
||
fake-aws-sqs: | ||
queueNames: | ||
- "integration-brig-events" | ||
- "integration-brig-events-internal" | ||
- "integration-gundeck-events" | ||
- "integration-user-events.fifo" | ||
- "integration-team-events.fifo" | ||
|
||
# No need for the set of queues with "2" as the suffix because the second | ||
# deployment of wire-server runs in a separate namespace (the "-fed2" | ||
# namespace) with its own fake-aws-sqs. | ||
# | ||
# In that namespace these extra queues will be unused, but its easier to | ||
# create them and not use them than to not create them. It shouldn't create | ||
# any significant perfomance degradation. | ||
- "integration-brig-events3" | ||
- "integration-brig-events-internal3" | ||
- "integration-gundeck-events3" | ||
- "integration-user-events3.fifo" | ||
- "integration-team-events3.fifo" | ||
|
||
- "integration-brig-events4" | ||
- "integration-brig-events-internal4" | ||
- "integration-gundeck-events4" | ||
- "integration-user-events4.fifo" | ||
- "integration-team-events4.fifo" | ||
|
||
- "integration-brig-events5" | ||
- "integration-brig-events-internal5" | ||
- "integration-gundeck-events5" | ||
- "integration-user-events5.fifo" | ||
- "integration-team-events5.fifo" |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.