diff --git a/README.md b/README.md index ae71d38..40121aa 100644 --- a/README.md +++ b/README.md @@ -406,6 +406,7 @@ Known configuration parameters are: * `error_acknowledgements`: a chain of responsibility of objects that acknowledge/reject/requeue messages when an exception happens, see classes in `Hutch::Acknowledgements`. * `mq_exchange`: exchange to use for publishing (default: `hutch`) + * `mq_client_properties`: Bunny's [client properties](https://www.rabbitmq.com/docs/connections#capabilities) (default: `{}`) * `heartbeat`: [RabbitMQ heartbeat timeout](http://rabbitmq.com/heartbeats.html) (default: `30`) * `connection_timeout`: Bunny's socket open timeout (default: `11`) * `read_timeout`: Bunny's socket read timeout (default: `11`) @@ -542,6 +543,13 @@ Generate with HUTCH_CHANNEL_PREFETCH

The basic.qos prefetch value to use.

+ + connection_name + nil + String + HUTCH_CONNECTION_NAME +

Client-Provided Connection Name

+ connection_timeout 11 diff --git a/lib/hutch/broker.rb b/lib/hutch/broker.rb index ec24ee7..dc534b5 100644 --- a/lib/hutch/broker.rb +++ b/lib/hutch/broker.rb @@ -298,6 +298,8 @@ def connection_params params[:tls_ca_certificates] = @config[:mq_tls_ca_certificates] end params[:heartbeat] = @config[:heartbeat] + params[:client_properties] = @config[:mq_client_properties] + params[:connection_name] = @config[:connection_name] params[:connection_timeout] = @config[:connection_timeout] params[:read_timeout] = @config[:read_timeout] params[:write_timeout] = @config[:write_timeout] diff --git a/lib/hutch/config.rb b/lib/hutch/config.rb index 253c7a3..40bde7b 100644 --- a/lib/hutch/config.rb +++ b/lib/hutch/config.rb @@ -86,6 +86,9 @@ def self.boolean_setting(name, default_value) # Default: `0`, no limit. See Bunny and RabbitMQ documentation. number_setting :channel_prefetch, 0 + # [Client-Provided Connection Name](https://www.rabbitmq.com/docs/connections#client-provided-names) + string_setting :connection_name, nil + # Bunny's socket open timeout number_setting :connection_timeout, 11 @@ -171,6 +174,7 @@ def self.initialize(params = {}) # @return [Hash] def self.default_config @settings_defaults.merge({ + mq_client_properties: {}, mq_exchange_options: {}, mq_tls_cert: nil, mq_tls_key: nil,