Skip to content

Commit ab46c8e

Browse files
committed
2023 update
1 parent 2ceabe5 commit ab46c8e

File tree

5 files changed

+103
-22
lines changed

5 files changed

+103
-22
lines changed

.env

-1
This file was deleted.

config/rabbitmq.conf

+100-16
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,23 @@
265265
# ssl_handshake_timeout = 5000
266266

267267

268+
##
269+
## Loading Definitions
270+
## ====================
271+
##
272+
## Relevant documentation: https://www.rabbitmq.com/definitions.html#import-on-boot
273+
##
274+
## To import definitions from a local file on node boot, set the
275+
## load_definitions config key to a path of a previously exported
276+
## JSON file with definitions. Does not require management plugin
277+
## to be enabled.
278+
##
279+
# load_definitions = /path/to/definitions/file.json
280+
281+
282+
##
268283
## Cluster name
284+
## ====================
269285
##
270286
# cluster_name = dev3.eng.megacorp.local
271287

@@ -739,7 +755,7 @@
739755
# stomp.tcp_listen_options.nodelay = true
740756
#
741757
# stomp.tcp_listen_options.exit_on_close = true
742-
# stomp.tcp_listen_options.send_timeout = 120
758+
# stomp.tcp_listen_options.send_timeout = 120000
743759

744760
## Proxy protocol support
745761
##
@@ -811,18 +827,19 @@
811827
##
812828
# mqtt.listeners.tcp.1 = 127.0.0.1:61613
813829
# mqtt.listeners.tcp.2 = ::1:61613
830+
mqtt.listeners.tcp.1 = 0.0.0.0:1883
814831

815832
## TCP listener options (as per the broker configuration).
816833
##
817-
# mqtt.tcp_listen_options.backlog = 4096
818-
# mqtt.tcp_listen_options.recbuf = 131072
819-
# mqtt.tcp_listen_options.sndbuf = 131072
834+
mqtt.tcp_listen_options.backlog = 4096
835+
mqtt.tcp_listen_options.recbuf = 131072
836+
mqtt.tcp_listen_options.sndbuf = 131072
820837
#
821-
# mqtt.tcp_listen_options.keepalive = true
822-
# mqtt.tcp_listen_options.nodelay = true
838+
mqtt.tcp_listen_options.keepalive = true
839+
mqtt.tcp_listen_options.nodelay = true
823840
#
824-
# mqtt.tcp_listen_options.exit_on_close = true
825-
# mqtt.tcp_listen_options.send_timeout = 120
841+
mqtt.tcp_listen_options.exit_on_close = true
842+
mqtt.tcp_listen_options.send_timeout = 120000
826843

827844
## TLS listener settings
828845
## ## See https://rabbitmq.com/mqtt.html and https://rabbitmq.com/ssl.html for details.
@@ -840,8 +857,8 @@
840857
## Number of Erlang processes that will accept connections for the TCP
841858
## and TLS listeners.
842859
##
843-
# mqtt.num_acceptors.tcp = 10
844-
# mqtt.num_acceptors.ssl = 10
860+
mqtt.num_acceptors.tcp = 10
861+
mqtt.num_acceptors.ssl = 10
845862

846863
## Whether or not to enable proxy protocol support.
847864
## Once enabled, clients cannot directly connect to the broker
@@ -856,14 +873,14 @@
856873
## Set the default user name and password used for anonymous connections (when client
857874
## provides no credentials). Anonymous connections are highly discouraged!
858875
##
859-
# mqtt.default_user = guest
860-
# mqtt.default_pass = guest
876+
mqtt.default_user = admin
877+
mqtt.default_pass = instar
861878

862879
## Enable anonymous connections. If this is set to false, clients MUST provide
863880
## credentials in order to connect. See also the mqtt.default_user/mqtt.default_pass
864881
## keys. Anonymous connections are highly discouraged!
865882
##
866-
# mqtt.allow_anonymous = true
883+
mqtt.allow_anonymous = false
867884

868885
## If you have multiple vhosts, specify the one to which the
869886
## adapter connects.
@@ -876,12 +893,79 @@
876893

877894
## Specify TTL (time to live) to control the lifetime of non-clean sessions.
878895
##
879-
# mqtt.subscription_ttl = 1800000
896+
mqtt.subscription_ttl = 1800000
880897

881898
## Set the prefetch count (governing the maximum number of unacknowledged
882899
## messages that will be delivered).
883900
##
884-
# mqtt.prefetch = 10
901+
mqtt.prefetch = 10
902+
903+
## Sets the durable queue type to be used for QoS 1 subscriptions.
904+
##
905+
## Supported types are:
906+
##
907+
## * classic
908+
## * quorum
909+
##
910+
## IMPORTANT: changing this setting requires all existing queues used by
911+
## the MQTT plugin to be DELETED or clients will fail to subscribe.
912+
## So this setting should be used for new clusters.
913+
##
914+
mqtt.durable_queue_type = classic
915+
#
916+
# =======================================
917+
# MQTT over WS section
918+
# =======================================
919+
web_mqtt.tcp.port = 9001
920+
# web_mqtt.ssl.port = 15676
921+
# web_mqtt.ssl.backlog = 1024
922+
# web_mqtt.ssl.cacertfile = /path/to/ca_certificate.pem
923+
# web_mqtt.ssl.certfile = /path/to/server_certificate.pem
924+
# web_mqtt.ssl.keyfile = /path/to/server_key.pem
925+
# needed when private key has a passphrase
926+
# web_mqtt.ssl.password = changeme
927+
# web_mqtt.ssl.port = 15676
928+
# web_mqtt.ssl.backlog = 1024
929+
# web_mqtt.ssl.certfile = /path/to/server_certificate.pem
930+
# web_mqtt.ssl.keyfile = /path/to/server_key.pem
931+
# web_mqtt.ssl.cacertfile = /path/to/ca_certificate_bundle.pem
932+
# web_mqtt.ssl.password = changeme
933+
934+
# web_mqtt.ssl.honor_cipher_order = true
935+
# web_mqtt.ssl.honor_ecc_order = true
936+
# web_mqtt.ssl.client_renegotiation = false
937+
# web_mqtt.ssl.secure_renegotiate = true
938+
939+
# web_mqtt.ssl.versions.1 = tlsv1.2
940+
# web_mqtt.ssl.versions.2 = tlsv1.1
941+
# web_mqtt.ssl.ciphers.1 = ECDHE-ECDSA-AES256-GCM-SHA384
942+
# web_mqtt.ssl.ciphers.2 = ECDHE-RSA-AES256-GCM-SHA384
943+
# web_mqtt.ssl.ciphers.3 = ECDHE-ECDSA-AES256-SHA384
944+
# web_mqtt.ssl.ciphers.4 = ECDHE-RSA-AES256-SHA384
945+
# web_mqtt.ssl.ciphers.5 = ECDH-ECDSA-AES256-GCM-SHA384
946+
# web_mqtt.ssl.ciphers.6 = ECDH-RSA-AES256-GCM-SHA384
947+
# web_mqtt.ssl.ciphers.7 = ECDH-ECDSA-AES256-SHA384
948+
# web_mqtt.ssl.ciphers.8 = ECDH-RSA-AES256-SHA384
949+
# web_mqtt.ssl.ciphers.9 = DHE-RSA-AES256-GCM-SHA384
950+
# web_mqtt.proxy_protocol = true
951+
#
952+
## Cowboy HTTP
953+
# connection inactivity timeout
954+
web_mqtt.cowboy_opts.idle_timeout = 60000
955+
# max number of pending requests allowed on a connection
956+
web_mqtt.cowboy_opts.max_keepalive = 200
957+
# max number of headers in a request
958+
web_mqtt.cowboy_opts.max_headers = 100
959+
# max number of empty lines before request body
960+
web_mqtt.cowboy_opts.max_empty_lines = 5
961+
# max request line length allowed in requests
962+
web_mqtt.cowboy_opts.max_request_line_length = 8000
963+
964+
# WebSocket traffic compression is enabled by default
965+
web_mqtt.ws_opts.compress = true
966+
# WebSocket connection inactivity timeout
967+
web_mqtt.ws_opts.idle_timeout = 60000
968+
web_mqtt.ws_opts.max_frame_size = 50000
885969

886970

887971
## ----------------------------------------------------------------------------
@@ -1072,4 +1156,4 @@
10721156
##
10731157
## {tag_queries, []}
10741158
# ]},
1075-
# -----------------------------
1159+
# -----------------------------

docker-compose.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
version: "3.8"
22
services:
33
rabbitmq:
4-
image: rabbitmq:${IMAGE_VERSION}
4+
image: rabbitmq:management-alpine
55
container_name: rabbitmq
66
restart: unless-stopped
77
build:
8-
context: rabbitmq/
8+
context: docker/
99
ports:
1010
- "1883:1883"
1111
- "5672:5672"

docker/Dockerfile

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,2 @@
1-
ARG IMAGE_VERSION
2-
3-
FROM rabbitmq:${IMAGE_VERSION}
1+
FROM rabbitmq:management-alpine
42
RUN rabbitmq-plugins enable --offline rabbitmq_mqtt rabbitmq_web_mqtt rabbitmq_amqp1_0

rabbitmq_mqtt_ws_01.png

-22.6 KB
Loading

0 commit comments

Comments
 (0)