lib/amq/client/async/adapters/event_machine.rb in amq-client-0.9.10 vs lib/amq/client/async/adapters/event_machine.rb in amq-client-0.9.11
- old
+ new
@@ -29,10 +29,11 @@
# @option settings [String] :host ("127.0.0.1") Hostname AMQ broker runs on.
# @option settings [String] :port (5672) Port AMQ broker listens on.
# @option settings [String] :vhost ("/") Virtual host to use.
# @option settings [String] :user ("guest") Username to use for authentication.
# @option settings [String] :pass ("guest") Password to use for authentication.
+ # @option settings [String] :auth_mechanism ("PLAIN") SASL authentication mechanism to use.
# @option settings [String] :ssl (false) Should be use TLS (SSL) for connection?
# @option settings [String] :timeout (nil) Connection timeout.
# @option settings [String] :logging (false) Turns logging on or off.
# @option settings [String] :broker (nil) Broker name (use if you intend to use broker-specific features).
# @option settings [Fixnum] :frame_max (131072) Maximum frame size to use. If broker cannot support frames this large, broker's maximum value will be used instead.
@@ -162,10 +163,10 @@
}
@on_possible_authentication_failure = @settings[:on_possible_authentication_failure] || Proc.new { |settings|
raise self.class.authentication_failure_exception_class.new(settings)
}
- @mechanism = "PLAIN"
+ @mechanism = @settings.fetch(:auth_mechanism, "PLAIN")
@locale = @settings.fetch(:locale, "en_GB")
@client_properties = Settings.client_properties.merge(@settings.fetch(:client_properties, Hash.new))
@auto_recovery = (!!@settings[:auto_recovery])