22
33require 'carrot-top'
44require 'forwardable'
5+ require 'ostruct'
56require 'hutch/logging'
67require 'hutch/exceptions'
78require 'hutch/publisher'
@@ -59,16 +60,16 @@ def connect(options = {})
5960 @options = options
6061 set_up_amqp_connection
6162 if http_api_use_enabled?
62- logger . info ' HTTP API use is enabled'
63+ logger . info " HTTP API use is enabled"
6364 set_up_api_connection
6465 else
65- logger . info ' HTTP API use is disabled'
66+ logger . info " HTTP API use is disabled"
6667 end
6768
6869 if tracing_enabled?
6970 logger . info "tracing is enabled using #{ @config [ :tracer ] } "
7071 else
71- logger . info ' tracing is disabled'
72+ logger . info " tracing is disabled"
7273 end
7374
7475 return unless block_given?
@@ -284,7 +285,7 @@ def api_config
284285 config . username = @config [ :mq_username ]
285286 config . password = @config [ :mq_password ]
286287 config . ssl = @config [ :mq_api_ssl ]
287- config . protocol = config . ssl ? ' https://' : ' http://'
288+ config . protocol = config . ssl ? " https://" : " http://"
288289 config . sanitized_uri = "#{ config . protocol } #{ config . username } @#{ config . host } :#{ config . port } /"
289290 end
290291 end
@@ -296,6 +297,7 @@ def connection_params
296297 params [ :host ] = @config [ :mq_host ]
297298 params [ :port ] = @config [ :mq_port ]
298299 params [ :vhost ] = @config [ :mq_vhost ] . presence || Hutch ::Adapter ::DEFAULT_VHOST
300+ params [ :auth_mechanism ] = @config [ :mq_auth_mechanism ]
299301 params [ :username ] = @config [ :mq_username ]
300302 params [ :password ] = @config [ :mq_password ]
301303 params [ :tls ] = @config [ :mq_tls ]
@@ -306,10 +308,13 @@ def connection_params
306308 params [ :tls_ca_certificates ] = @config [ :mq_tls_ca_certificates ]
307309 end
308310 params [ :heartbeat ] = @config [ :heartbeat ]
311+ params [ :client_properties ] = @config [ :mq_client_properties ]
312+ params [ :connection_name ] = @config [ :connection_name ]
309313 params [ :connection_timeout ] = @config [ :connection_timeout ]
310314 params [ :read_timeout ] = @config [ :read_timeout ]
311315 params [ :write_timeout ] = @config [ :write_timeout ]
312316
317+
313318 params [ :automatically_recover ] = @config [ :automatically_recover ]
314319 params [ :network_recovery_interval ] = @config [ :network_recovery_interval ]
315320
@@ -325,7 +330,7 @@ def parse_uri
325330 @config [ :mq_tls ] = u . scheme == 'amqps'
326331 @config [ :mq_host ] = u . host
327332 @config [ :mq_port ] = u . port || default_mq_port
328- @config [ :mq_vhost ] = u . path . sub ( %r{^/} , '' )
333+ @config [ :mq_vhost ] = u . path . sub ( /^ \/ / , "" )
329334 @config [ :mq_username ] = u . user
330335 @config [ :mq_password ] = u . password
331336 end
@@ -336,9 +341,9 @@ def default_mq_port
336341
337342 def sanitized_uri
338343 p = connection_params
339- scheme = p [ :tls ] ? ' amqps' : ' amqp'
344+ scheme = p [ :tls ] ? " amqps" : " amqp"
340345
341- "#{ scheme } ://#{ p [ :username ] } @#{ p [ :host ] } :#{ p [ :port ] } /#{ p [ :vhost ] . sub ( %r{^/} , '' ) } "
346+ "#{ scheme } ://#{ p [ :username ] } @#{ p [ :host ] } :#{ p [ :port ] } /#{ p [ :vhost ] . sub ( /^ \/ / , '' ) } "
342347 end
343348
344349 def channel_work_pool
0 commit comments