basquiat 1.5.2 → 1.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -0
- data/lib/basquiat/adapters/rabbitmq/connection.rb +22 -9
- data/lib/basquiat/version.rb +1 -1
- metadata +4 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fc27c1c985d61c6612a636891ee1e1007d281aecc1b57cf5df37fed3427c0b2c
|
4
|
+
data.tar.gz: 67232d9a873b73787a8dd27e49d43f47eba67b5dd6f6b3d5c732aede3abf5c46
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7aceb6a7d73c8e260af5fad4ed7c639e937d164380d5d6b68c90c5319fe49cf8367dea5c72338f27dfef5d015a9dd3ea191b62c4f8fa580c2e8a876e9fe46737
|
7
|
+
data.tar.gz: 50f2ffa465e84819c6053f8304b520e2891fdacd3de142f01e59b84231a3fbfc1ca40d384325a1c7c7343ba13fb50cf961f608e8bdbd20fdbe16f38679d1a890
|
data/README.md
CHANGED
@@ -101,9 +101,12 @@ development: #full example of the RabbitMq option
|
|
101
101
|
hosts:
|
102
102
|
- 'localhost'
|
103
103
|
port: 5672
|
104
|
+
vhost: '/'
|
104
105
|
auth:
|
105
106
|
user: 'guest'
|
106
107
|
password: 'guest'
|
108
|
+
tls_options:
|
109
|
+
tls: false
|
107
110
|
publisher:
|
108
111
|
confirm: true
|
109
112
|
persistent: true
|
@@ -7,6 +7,12 @@ module Basquiat
|
|
7
7
|
class Connection < SimpleDelegator
|
8
8
|
# @param hosts: [Array<String>] IPs or FQDN of the RabbitMQ instances
|
9
9
|
# @param port [Fixnum] Port that the RabbitMQ instances run
|
10
|
+
# @param vhost [String] Virtual host
|
11
|
+
# @option tls_options [Boolean] :tls when set to true, will set SSL context up and switch to TLS port (5671)
|
12
|
+
# @option tls_options [String] :tls_cert string path to the client certificate (public key) in PEM format
|
13
|
+
# @option tls_options [String] :tls_key string path to the client key (private key) in PEM format
|
14
|
+
# @option tls_options [Array<String>] :tls_ca_certificates array of string paths to CA certificates in PEM format
|
15
|
+
# @option tls_options [Boolean] :verify_peer determines if TLS peer authentication (verification) is performed, true by default
|
10
16
|
# @option failover: [Fixnum|Symbol] :heartbeat (:server) Heartbeat timeout to offer to the server
|
11
17
|
# @option failover: [Fixnum] :max_retries (5) Maximum number of reconnection retries
|
12
18
|
# @option failover: [Fixnum] :default_timeout (5) Interval between to reconnect attempts
|
@@ -15,11 +21,13 @@ module Basquiat
|
|
15
21
|
# @option failover: [Fixnum] :write_timeout (30) TCP socket write timeout in seconds
|
16
22
|
# @option auth: [String] :user ('guest')
|
17
23
|
# @option auth: [String] :password ('guest')
|
18
|
-
def initialize(hosts:, port: 5672, failover: {}, auth: {})
|
19
|
-
@hosts
|
20
|
-
@port
|
21
|
-
@
|
22
|
-
@
|
24
|
+
def initialize(hosts:, port: 5672, vhost: '/', tls_options: {}, failover: {}, auth: {})
|
25
|
+
@hosts = hosts
|
26
|
+
@port = port
|
27
|
+
@vhost = vhost
|
28
|
+
@tls_options = tls_options
|
29
|
+
@failover = failover
|
30
|
+
@auth = auth
|
23
31
|
end
|
24
32
|
|
25
33
|
# Creates a channel
|
@@ -55,10 +63,10 @@ module Basquiat
|
|
55
63
|
__setobj__(nil)
|
56
64
|
end
|
57
65
|
|
58
|
-
def
|
59
|
-
@
|
60
|
-
hosts: @hosts,
|
66
|
+
def configuration
|
67
|
+
{ hosts: @hosts,
|
61
68
|
port: @port,
|
69
|
+
vhost: @vhost,
|
62
70
|
username: @auth.fetch(:user, 'guest'),
|
63
71
|
password: @auth.fetch(:password, 'guest'),
|
64
72
|
heartbeat: @failover.fetch(:heartbeat, :server),
|
@@ -67,7 +75,12 @@ module Basquiat
|
|
67
75
|
connection_timeout: @failover.fetch(:connection_timeout, 5),
|
68
76
|
read_timeout: @failover.fetch(:read_timeout, 30),
|
69
77
|
write_timeout: @failover.fetch(:write_timeout, 30),
|
70
|
-
logger: Basquiat.logger
|
78
|
+
logger: Basquiat.logger }.merge(@tls_options)
|
79
|
+
end
|
80
|
+
|
81
|
+
def connection
|
82
|
+
@connection ||= Basquiat.configuration.connection || Bunny.new(
|
83
|
+
configuration
|
71
84
|
)
|
72
85
|
__setobj__(@connection)
|
73
86
|
end
|
data/lib/basquiat/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: basquiat
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Marcello "mereghost" Rocha
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2019-07-30 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
@@ -266,7 +266,7 @@ dependencies:
|
|
266
266
|
description: 'Basquiat is a library that intends to abstract all the complexity of
|
267
267
|
working with message queues
|
268
268
|
|
269
|
-
'
|
269
|
+
'
|
270
270
|
email:
|
271
271
|
- marcello.rocha@gmail.com.br
|
272
272
|
- dadario@gmail.com
|
@@ -348,8 +348,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
348
348
|
- !ruby/object:Gem::Version
|
349
349
|
version: '0'
|
350
350
|
requirements: []
|
351
|
-
|
352
|
-
rubygems_version: 2.7.6
|
351
|
+
rubygems_version: 3.0.4
|
353
352
|
signing_key:
|
354
353
|
specification_version: 4
|
355
354
|
summary: A pluggable library that aims to hide message queue complexity
|