Skip to content

Commit

Permalink
feat: support for AMQPS for rabbitmq connections (#1911)
Browse files Browse the repository at this point in the history
* Support AMQPS

* Update rabbit_mq.rb
  • Loading branch information
dragoangel authored Mar 16, 2022
1 parent d4aebac commit 9f0697f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions config/postal.defaults.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ message_db:
rabbitmq:
host: 127.0.0.1
port: 5672
tls: false
verify_peer: true
tls_ca_certificates:
- /etc/ssl/certs/ca-certificates.crt
username: postal
password:
vhost: /postal
Expand Down
3 changes: 3 additions & 0 deletions lib/postal/rabbit_mq.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ def self.create_connection
conn = Bunny.new(
:hosts => bunny_host,
:port => Postal.config.rabbitmq&.port || 5672,
:tls => Postal.config.rabbitmq&.tls || false,
:verify_peer => Postal.config.rabbitmq&.verify_peer || true,
:tls_ca_certificates => Postal.config.rabbitmq&.tls_ca_certificates || [ "/etc/ssl/certs/ca-certificates.crt" ],
:username => Postal.config.rabbitmq&.username || 'guest',
:password => Postal.config.rabbitmq&.password || 'guest',
:vhost => Postal.config.rabbitmq&.vhost || nil
Expand Down

0 comments on commit 9f0697f

Please sign in to comment.