-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] Add the ssl_options
as new options for AMQP client
#138
base: main
Are you sure you want to change the base?
Conversation
@@ -301,6 +310,16 @@ defmodule BroadwayRabbitMQ.AmqpClient do | |||
Connection.close(channel.conn) | |||
end | |||
|
|||
defp open_connection_instrumented(%{connection: connection} = config) when is_binary(connection) do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need this separate branch? Also, could we pass all options forward, instead of only ssl_options
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function can be a bit confusing, but what I am seeing is that AMQP.Connection.open
can receive a URL or Keyword with host, username, password and etc.
So this branch is to make it work two scenarios:
- Url is string, so we call
AMQP.Connection.open/2
passing url and options - connection is a Keyword, so
AMQP.Connection.open/1
is called.
Maybe for scenario 2 I can append the ssl options, but I see it already expects it as part of the possible options schema
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In other words, ssl_options are already supported if you pass a keyword list? Maybe you should pass a keyword list then and document this behaviour?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In theory yes, I will test that to make sure It works as I am expecting it to.
required: false, | ||
doc: """ | ||
Defined the SSL settings for the connection with RabbitMQ. | ||
Check `AMQP.Connection.open/2` for the full list of SSL options. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check `AMQP.Connection.open/2` for the full list of SSL options. | |
This is the same as `:ssl_options` passed to `AMQP.Connection.open/2`. |
type: :any, | ||
required: false, | ||
doc: """ | ||
Defined the SSL settings for the connection with RabbitMQ. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Defined the SSL settings for the connection with RabbitMQ. | |
SSL settings for the connection with RabbitMQ. |
broadway: [type: :any, doc: false], | ||
ssl_options: [ | ||
type: :any, | ||
required: false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not necessary.
required: false, |
No description provided.