Skip to content

Commit

Permalink
add sasl mechanism option
Browse files Browse the repository at this point in the history
  • Loading branch information
nasark committed Sep 1, 2023
1 parent e574103 commit ea16bb1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/manageiq/messaging/kafka/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -88,15 +88,15 @@ def rdkafka_connection_opts(options)
result = {:"bootstrap.servers" => hosts.join(',')}
result[:"client.id"] = options[:client_ref] if options[:client_ref]

result[:"sasl.mechanism"] = "PLAIN"
result[:"sasl.mechanism"] = options[:sasl_mechanism] || "PLAIN"
result[:"sasl.username"] = options[:username] if options[:username]
result[:"sasl.password"] = options[:password] if options[:password]
result[:"security.protocol"] = !!options[:ssl] ? "SASL_SSL" : "PLAINTEXT"
result[:"ssl.ca.location"] = options[:ca_file] if options[:ca_file]
result[:"ssl.keystore.location"] = options[:keystore_location] if options[:keystore_location]
result[:"ssl.keystore.password"] = options[:keystore_password] if options[:keystore_password]

result.merge(options.except(:port, :host, :hosts, :encoding, :protocol, :client_ref, :username, :password, :ssl, :ca_file, :keystore_location, :keystore_password))
result.merge(options.except(:port, :host, :hosts, :encoding, :protocol, :client_ref, :sasl_mechanism, :username, :password, :ssl, :ca_file, :keystore_location, :keystore_password))
end
end
end
Expand Down

0 comments on commit ea16bb1

Please sign in to comment.