Yggdrasil for RabbitMQ v5.0.1 Yggdrasil.Settings.RabbitMQ View Source
This module defines the available settings for RabbitMQ in Yggdrasil.
Link to this section Summary
Functions
RabbitMQ heartbeat. Defaults to 10 seconds.
RabbitMQ heartbeat. Defaults to 10 seconds.
RabbitMQ hostname. Defaults to "localhost".
RabbitMQ hostname. Defaults to "localhost".
RabbitMQ max retries for the backoff algorithm. Defaults to 3.
RabbitMQ max retries for the backoff algorithm. Defaults to 3.
RabbitMQ password. Defaults to "guest".
RabbitMQ password. Defaults to "guest".
RabbitMQ port. Defaults to 5672.
RabbitMQ port. Defaults to 5672.
RabbitMQ amount of publisher connections.
RabbitMQ amount of publisher connections.
Puts the value to Yggdrasil.Settings.RabbitMQ.heartbeat/0. Optionally, receives
the namespace.
Puts the value to Yggdrasil.Settings.RabbitMQ.hostname/0. Optionally, receives
the namespace.
Puts the value to Yggdrasil.Settings.RabbitMQ.max_retries/0. Optionally, receives
the namespace.
Puts the value to Yggdrasil.Settings.RabbitMQ.password/0. Optionally, receives
the namespace.
Puts the value to Yggdrasil.Settings.RabbitMQ.port/0. Optionally, receives
the namespace.
Puts the value to Yggdrasil.Settings.RabbitMQ.publisher_connections/0. Optionally, receives
the namespace.
Puts the value to Yggdrasil.Settings.RabbitMQ.slot_size/0. Optionally, receives
the namespace.
Puts the value to Yggdrasil.Settings.RabbitMQ.subscriber_connections/0. Optionally, receives
the namespace.
Puts the value to Yggdrasil.Settings.RabbitMQ.username/0. Optionally, receives
the namespace.
Puts the value to Yggdrasil.Settings.RabbitMQ.virtual_host/0. Optionally, receives
the namespace.
Reloads the value for Yggdrasil.Settings.RabbitMQ.heartbeat/0. Optionally, receives
the namespace for the variable.
Reloads the value for Yggdrasil.Settings.RabbitMQ.hostname/0. Optionally, receives
the namespace for the variable.
Reloads the value for Yggdrasil.Settings.RabbitMQ.max_retries/0. Optionally, receives
the namespace for the variable.
Reloads the value for Yggdrasil.Settings.RabbitMQ.password/0. Optionally, receives
the namespace for the variable.
Reloads the value for Yggdrasil.Settings.RabbitMQ.port/0. Optionally, receives
the namespace for the variable.
Reloads the value for Yggdrasil.Settings.RabbitMQ.publisher_connections/0. Optionally, receives
the namespace for the variable.
Reloads the value for Yggdrasil.Settings.RabbitMQ.slot_size/0. Optionally, receives
the namespace for the variable.
Reloads the value for Yggdrasil.Settings.RabbitMQ.subscriber_connections/0. Optionally, receives
the namespace for the variable.
Reloads the value for Yggdrasil.Settings.RabbitMQ.username/0. Optionally, receives
the namespace for the variable.
Reloads the value for Yggdrasil.Settings.RabbitMQ.virtual_host/0. Optionally, receives
the namespace for the variable.
RabbitMQ slot size for the backoff algorithm. Defaults to 10.
RabbitMQ slot size for the backoff algorithm. Defaults to 10.
RabbitMQ amount of subscriber connections.
RabbitMQ amount of subscriber connections.
RabbitMQ username. Defaults to "guest".
RabbitMQ username. Defaults to "guest".
RabbitMQ virtual host. Defaults to "/".
RabbitMQ virtual host. Defaults to "/".
Link to this section Functions
heartbeat(namespace \\ nil)
View Sourceheartbeat(Skogsra.Env.namespace()) :: {:ok, term()} | {:error, term()}
RabbitMQ heartbeat. Defaults to 10 seconds.
iex> Yggdrasil.Settings.RabbitMQ.heartbeat()
{:ok, 10}
A call to Yggdrasil.Settings.RabbitMQ.heartbeat():
- When the OS environment variable is not
nil, then it'll return its casted value. - When the OS environment variable is
nil, then it'll try to get the value from the configuration file. - When the configuration file does not contain the variable, then it'll return the default value if it's defined.
- When the default value is not defined and it's not required, it'll
return
nil, otherwise it'll return an error.
A call to Yggdrasil.Settings.RabbitMQ.heartbeat(namespace) will try
to do the same as before, but with a namespace (atom()). This is
useful for spliting different configurations values for the same variable
e.g. different environments.
The OS environment variables expected are:
- When no namespace is specified, then it'll be
$YGGDRASIL_RABBITMQ_HEARTBEAT. - When a namespace is specified e.g.
My.Custom.Namespace, then it'll be$MY_CUSTOM_NAMESPACE_YGGDRASIL_RABBITMQ_HEARTBEAT.
The expected application configuration would be as follows:
- Without namespace:
config :yggdrasil,
rabbitmq: [
heartbeat: :integer() # Defaults to 10
]
- With namespace e.g.
My.Custom.Namespace:
config :yggdrasil, My.Custom.Namespace,
rabbitmq: [
heartbeat: :integer() # Defaults to 10
]
heartbeat!(namespace \\ nil)
View Sourceheartbeat!(Skogsra.Env.namespace()) :: {:ok, term()} | {:error, term()}
RabbitMQ heartbeat. Defaults to 10 seconds.
iex> Yggdrasil.Settings.RabbitMQ.heartbeat()
{:ok, 10}
Bang version of Yggdrasil.Settings.RabbitMQ.heartbeat/0 (fails on error).
hostname(namespace \\ nil)
View Sourcehostname(Skogsra.Env.namespace()) :: {:ok, term()} | {:error, term()}
RabbitMQ hostname. Defaults to "localhost".
A call to Yggdrasil.Settings.RabbitMQ.hostname():
- When the OS environment variable is not
nil, then it'll return its casted value. - When the OS environment variable is
nil, then it'll try to get the value from the configuration file. - When the configuration file does not contain the variable, then it'll return the default value if it's defined.
- When the default value is not defined and it's not required, it'll
return
nil, otherwise it'll return an error.
A call to Yggdrasil.Settings.RabbitMQ.hostname(namespace) will try
to do the same as before, but with a namespace (atom()). This is
useful for spliting different configurations values for the same variable
e.g. different environments.
The OS environment variables expected are:
- When no namespace is specified, then it'll be
$YGGDRASIL_RABBITMQ_HOSTNAME. - When a namespace is specified e.g.
My.Custom.Namespace, then it'll be$MY_CUSTOM_NAMESPACE_YGGDRASIL_RABBITMQ_HOSTNAME.
The expected application configuration would be as follows:
- Without namespace:
config :yggdrasil,
rabbitmq: [
hostname: :binary() # Defaults to "localhost"
]
- With namespace e.g.
My.Custom.Namespace:
config :yggdrasil, My.Custom.Namespace,
rabbitmq: [
hostname: :binary() # Defaults to "localhost"
]
hostname!(namespace \\ nil)
View Sourcehostname!(Skogsra.Env.namespace()) :: {:ok, term()} | {:error, term()}
RabbitMQ hostname. Defaults to "localhost".
Bang version of Yggdrasil.Settings.RabbitMQ.hostname/0 (fails on error).
max_retries(namespace \\ nil)
View Sourcemax_retries(Skogsra.Env.namespace()) :: {:ok, term()} | {:error, term()}
RabbitMQ max retries for the backoff algorithm. Defaults to 3.
The backoff algorithm is exponential:
backoff_time = pow(2, retries) * random(1, slot) * 1_000 ms
when retries <= MAX_RETRIES and slot is given by the configuration
variable Elixir.Yggdrasil.Settings.RabbitMQ.slot_size/0 (defaults to 10 secs).
iex> Yggdrasil.Settings.RabbitMQ.max_retries()
{:ok, 3}
A call to Yggdrasil.Settings.RabbitMQ.max_retries():
- When the OS environment variable is not
nil, then it'll return its casted value. - When the OS environment variable is
nil, then it'll try to get the value from the configuration file. - When the configuration file does not contain the variable, then it'll return the default value if it's defined.
- When the default value is not defined and it's not required, it'll
return
nil, otherwise it'll return an error.
A call to Yggdrasil.Settings.RabbitMQ.max_retries(namespace) will try
to do the same as before, but with a namespace (atom()). This is
useful for spliting different configurations values for the same variable
e.g. different environments.
The OS environment variables expected are:
- When no namespace is specified, then it'll be
$YGGDRASIL_RABBITMQ_MAX_RETRIES. - When a namespace is specified e.g.
My.Custom.Namespace, then it'll be$MY_CUSTOM_NAMESPACE_YGGDRASIL_RABBITMQ_MAX_RETRIES.
The expected application configuration would be as follows:
- Without namespace:
config :yggdrasil,
rabbitmq: [
max_retries: :integer() # Defaults to 3
]
- With namespace e.g.
My.Custom.Namespace:
config :yggdrasil, My.Custom.Namespace,
rabbitmq: [
max_retries: :integer() # Defaults to 3
]
max_retries!(namespace \\ nil)
View Sourcemax_retries!(Skogsra.Env.namespace()) :: {:ok, term()} | {:error, term()}
RabbitMQ max retries for the backoff algorithm. Defaults to 3.
The backoff algorithm is exponential:
backoff_time = pow(2, retries) * random(1, slot) * 1_000 ms
when retries <= MAX_RETRIES and slot is given by the configuration
variable Elixir.Yggdrasil.Settings.RabbitMQ.slot_size/0 (defaults to 10 secs).
iex> Yggdrasil.Settings.RabbitMQ.max_retries()
{:ok, 3}
Bang version of Yggdrasil.Settings.RabbitMQ.max_retries/0 (fails on error).
password(namespace \\ nil)
View Sourcepassword(Skogsra.Env.namespace()) :: {:ok, term()} | {:error, term()}
RabbitMQ password. Defaults to "guest".
iex> Yggdrasil.Settings.RabbitMQ.password()
{:ok, "guest"}
A call to Yggdrasil.Settings.RabbitMQ.password():
- When the OS environment variable is not
nil, then it'll return its casted value. - When the OS environment variable is
nil, then it'll try to get the value from the configuration file. - When the configuration file does not contain the variable, then it'll return the default value if it's defined.
- When the default value is not defined and it's not required, it'll
return
nil, otherwise it'll return an error.
A call to Yggdrasil.Settings.RabbitMQ.password(namespace) will try
to do the same as before, but with a namespace (atom()). This is
useful for spliting different configurations values for the same variable
e.g. different environments.
The OS environment variables expected are:
- When no namespace is specified, then it'll be
$YGGDRASIL_RABBITMQ_PASSWORD. - When a namespace is specified e.g.
My.Custom.Namespace, then it'll be$MY_CUSTOM_NAMESPACE_YGGDRASIL_RABBITMQ_PASSWORD.
The expected application configuration would be as follows:
- Without namespace:
config :yggdrasil,
rabbitmq: [
password: :binary() # Defaults to "guest"
]
- With namespace e.g.
My.Custom.Namespace:
config :yggdrasil, My.Custom.Namespace,
rabbitmq: [
password: :binary() # Defaults to "guest"
]
password!(namespace \\ nil)
View Sourcepassword!(Skogsra.Env.namespace()) :: {:ok, term()} | {:error, term()}
RabbitMQ password. Defaults to "guest".
iex> Yggdrasil.Settings.RabbitMQ.password()
{:ok, "guest"}
Bang version of Yggdrasil.Settings.RabbitMQ.password/0 (fails on error).
port(namespace \\ nil)
View Sourceport(Skogsra.Env.namespace()) :: {:ok, term()} | {:error, term()}
RabbitMQ port. Defaults to 5672.
iex> Yggdrasil.Settings.RabbitMQ.port()
{:ok, 5672}
A call to Yggdrasil.Settings.RabbitMQ.port():
- When the OS environment variable is not
nil, then it'll return its casted value. - When the OS environment variable is
nil, then it'll try to get the value from the configuration file. - When the configuration file does not contain the variable, then it'll return the default value if it's defined.
- When the default value is not defined and it's not required, it'll
return
nil, otherwise it'll return an error.
A call to Yggdrasil.Settings.RabbitMQ.port(namespace) will try
to do the same as before, but with a namespace (atom()). This is
useful for spliting different configurations values for the same variable
e.g. different environments.
The OS environment variables expected are:
- When no namespace is specified, then it'll be
$YGGDRASIL_RABBITMQ_PORT. - When a namespace is specified e.g.
My.Custom.Namespace, then it'll be$MY_CUSTOM_NAMESPACE_YGGDRASIL_RABBITMQ_PORT.
The expected application configuration would be as follows:
- Without namespace:
config :yggdrasil,
rabbitmq: [
port: :integer() # Defaults to 5672
]
- With namespace e.g.
My.Custom.Namespace:
config :yggdrasil, My.Custom.Namespace,
rabbitmq: [
port: :integer() # Defaults to 5672
]
port!(namespace \\ nil)
View Sourceport!(Skogsra.Env.namespace()) :: {:ok, term()} | {:error, term()}
RabbitMQ port. Defaults to 5672.
iex> Yggdrasil.Settings.RabbitMQ.port()
{:ok, 5672}
Bang version of Yggdrasil.Settings.RabbitMQ.port/0 (fails on error).
publisher_connections(namespace \\ nil)
View Sourcepublisher_connections(Skogsra.Env.namespace()) :: {:ok, term()} | {:error, term()}
RabbitMQ amount of publisher connections.
iex> Yggdrasil.Settings.RabbitMQ.publisher_connections()
{:ok, 1}
A call to Yggdrasil.Settings.RabbitMQ.publisher_connections():
- When the OS environment variable is not
nil, then it'll return its casted value. - When the OS environment variable is
nil, then it'll try to get the value from the configuration file. - When the configuration file does not contain the variable, then it'll return the default value if it's defined.
- When the default value is not defined and it's not required, it'll
return
nil, otherwise it'll return an error.
A call to Yggdrasil.Settings.RabbitMQ.publisher_connections(namespace) will try
to do the same as before, but with a namespace (atom()). This is
useful for spliting different configurations values for the same variable
e.g. different environments.
The OS environment variables expected are:
- When no namespace is specified, then it'll be
$YGGDRASIL_RABBITMQ_PUBLISHER_CONNECTIONS. - When a namespace is specified e.g.
My.Custom.Namespace, then it'll be$MY_CUSTOM_NAMESPACE_YGGDRASIL_RABBITMQ_PUBLISHER_CONNECTIONS.
The expected application configuration would be as follows:
- Without namespace:
config :yggdrasil,
rabbitmq: [
publisher_connections: :integer() # Defaults to 1
]
- With namespace e.g.
My.Custom.Namespace:
config :yggdrasil, My.Custom.Namespace,
rabbitmq: [
publisher_connections: :integer() # Defaults to 1
]
publisher_connections!(namespace \\ nil)
View Sourcepublisher_connections!(Skogsra.Env.namespace()) :: {:ok, term()} | {:error, term()}
RabbitMQ amount of publisher connections.
iex> Yggdrasil.Settings.RabbitMQ.publisher_connections()
{:ok, 1}
Bang version of Yggdrasil.Settings.RabbitMQ.publisher_connections/0 (fails on error).
put_heartbeat(value, namespace \\ nil)
View Sourceput_heartbeat(term(), Skogsra.Env.namespace()) :: :ok | {:error, term()}
Puts the value to Yggdrasil.Settings.RabbitMQ.heartbeat/0. Optionally, receives
the namespace.
put_hostname(value, namespace \\ nil)
View Sourceput_hostname(term(), Skogsra.Env.namespace()) :: :ok | {:error, term()}
Puts the value to Yggdrasil.Settings.RabbitMQ.hostname/0. Optionally, receives
the namespace.
put_max_retries(value, namespace \\ nil)
View Sourceput_max_retries(term(), Skogsra.Env.namespace()) :: :ok | {:error, term()}
Puts the value to Yggdrasil.Settings.RabbitMQ.max_retries/0. Optionally, receives
the namespace.
put_password(value, namespace \\ nil)
View Sourceput_password(term(), Skogsra.Env.namespace()) :: :ok | {:error, term()}
Puts the value to Yggdrasil.Settings.RabbitMQ.password/0. Optionally, receives
the namespace.
put_port(value, namespace \\ nil)
View Sourceput_port(term(), Skogsra.Env.namespace()) :: :ok | {:error, term()}
Puts the value to Yggdrasil.Settings.RabbitMQ.port/0. Optionally, receives
the namespace.
put_publisher_connections(value, namespace \\ nil)
View Sourceput_publisher_connections(term(), Skogsra.Env.namespace()) :: :ok | {:error, term()}
Puts the value to Yggdrasil.Settings.RabbitMQ.publisher_connections/0. Optionally, receives
the namespace.
put_slot_size(value, namespace \\ nil)
View Sourceput_slot_size(term(), Skogsra.Env.namespace()) :: :ok | {:error, term()}
Puts the value to Yggdrasil.Settings.RabbitMQ.slot_size/0. Optionally, receives
the namespace.
put_subscriber_connections(value, namespace \\ nil)
View Sourceput_subscriber_connections(term(), Skogsra.Env.namespace()) :: :ok | {:error, term()}
Puts the value to Yggdrasil.Settings.RabbitMQ.subscriber_connections/0. Optionally, receives
the namespace.
put_username(value, namespace \\ nil)
View Sourceput_username(term(), Skogsra.Env.namespace()) :: :ok | {:error, term()}
Puts the value to Yggdrasil.Settings.RabbitMQ.username/0. Optionally, receives
the namespace.
put_virtual_host(value, namespace \\ nil)
View Sourceput_virtual_host(term(), Skogsra.Env.namespace()) :: :ok | {:error, term()}
Puts the value to Yggdrasil.Settings.RabbitMQ.virtual_host/0. Optionally, receives
the namespace.
reload_heartbeat(namespace \\ nil)
View Sourcereload_heartbeat(Skogsra.Env.namespace()) :: {:ok, term()} | {:error, term()}
Reloads the value for Yggdrasil.Settings.RabbitMQ.heartbeat/0. Optionally, receives
the namespace for the variable.
reload_hostname(namespace \\ nil)
View Sourcereload_hostname(Skogsra.Env.namespace()) :: {:ok, term()} | {:error, term()}
Reloads the value for Yggdrasil.Settings.RabbitMQ.hostname/0. Optionally, receives
the namespace for the variable.
reload_max_retries(namespace \\ nil)
View Sourcereload_max_retries(Skogsra.Env.namespace()) :: {:ok, term()} | {:error, term()}
Reloads the value for Yggdrasil.Settings.RabbitMQ.max_retries/0. Optionally, receives
the namespace for the variable.
reload_password(namespace \\ nil)
View Sourcereload_password(Skogsra.Env.namespace()) :: {:ok, term()} | {:error, term()}
Reloads the value for Yggdrasil.Settings.RabbitMQ.password/0. Optionally, receives
the namespace for the variable.
reload_port(namespace \\ nil)
View Sourcereload_port(Skogsra.Env.namespace()) :: {:ok, term()} | {:error, term()}
Reloads the value for Yggdrasil.Settings.RabbitMQ.port/0. Optionally, receives
the namespace for the variable.
reload_publisher_connections(namespace \\ nil)
View Sourcereload_publisher_connections(Skogsra.Env.namespace()) :: {:ok, term()} | {:error, term()}
Reloads the value for Yggdrasil.Settings.RabbitMQ.publisher_connections/0. Optionally, receives
the namespace for the variable.
reload_slot_size(namespace \\ nil)
View Sourcereload_slot_size(Skogsra.Env.namespace()) :: {:ok, term()} | {:error, term()}
Reloads the value for Yggdrasil.Settings.RabbitMQ.slot_size/0. Optionally, receives
the namespace for the variable.
reload_subscriber_connections(namespace \\ nil)
View Sourcereload_subscriber_connections(Skogsra.Env.namespace()) :: {:ok, term()} | {:error, term()}
Reloads the value for Yggdrasil.Settings.RabbitMQ.subscriber_connections/0. Optionally, receives
the namespace for the variable.
reload_username(namespace \\ nil)
View Sourcereload_username(Skogsra.Env.namespace()) :: {:ok, term()} | {:error, term()}
Reloads the value for Yggdrasil.Settings.RabbitMQ.username/0. Optionally, receives
the namespace for the variable.
reload_virtual_host(namespace \\ nil)
View Sourcereload_virtual_host(Skogsra.Env.namespace()) :: {:ok, term()} | {:error, term()}
Reloads the value for Yggdrasil.Settings.RabbitMQ.virtual_host/0. Optionally, receives
the namespace for the variable.
slot_size(namespace \\ nil)
View Sourceslot_size(Skogsra.Env.namespace()) :: {:ok, term()} | {:error, term()}
RabbitMQ slot size for the backoff algorithm. Defaults to 10.
iex> Yggdrasil.Settings.RabbitMQ.slot_size()
{:ok, 10}
A call to Yggdrasil.Settings.RabbitMQ.slot_size():
- When the OS environment variable is not
nil, then it'll return its casted value. - When the OS environment variable is
nil, then it'll try to get the value from the configuration file. - When the configuration file does not contain the variable, then it'll return the default value if it's defined.
- When the default value is not defined and it's not required, it'll
return
nil, otherwise it'll return an error.
A call to Yggdrasil.Settings.RabbitMQ.slot_size(namespace) will try
to do the same as before, but with a namespace (atom()). This is
useful for spliting different configurations values for the same variable
e.g. different environments.
The OS environment variables expected are:
- When no namespace is specified, then it'll be
$YGGDRASIL_RABBITMQ_SLOT_SIZE. - When a namespace is specified e.g.
My.Custom.Namespace, then it'll be$MY_CUSTOM_NAMESPACE_YGGDRASIL_RABBITMQ_SLOT_SIZE.
The expected application configuration would be as follows:
- Without namespace:
config :yggdrasil,
rabbitmq: [
slot_size: :integer() # Defaults to 10
]
- With namespace e.g.
My.Custom.Namespace:
config :yggdrasil, My.Custom.Namespace,
rabbitmq: [
slot_size: :integer() # Defaults to 10
]
slot_size!(namespace \\ nil)
View Sourceslot_size!(Skogsra.Env.namespace()) :: {:ok, term()} | {:error, term()}
RabbitMQ slot size for the backoff algorithm. Defaults to 10.
iex> Yggdrasil.Settings.RabbitMQ.slot_size()
{:ok, 10}
Bang version of Yggdrasil.Settings.RabbitMQ.slot_size/0 (fails on error).
subscriber_connections(namespace \\ nil)
View Sourcesubscriber_connections(Skogsra.Env.namespace()) :: {:ok, term()} | {:error, term()}
RabbitMQ amount of subscriber connections.
iex> Yggdrasil.Settings.RabbitMQ.subscriber_connections()
{:ok, 1}
A call to Yggdrasil.Settings.RabbitMQ.subscriber_connections():
- When the OS environment variable is not
nil, then it'll return its casted value. - When the OS environment variable is
nil, then it'll try to get the value from the configuration file. - When the configuration file does not contain the variable, then it'll return the default value if it's defined.
- When the default value is not defined and it's not required, it'll
return
nil, otherwise it'll return an error.
A call to Yggdrasil.Settings.RabbitMQ.subscriber_connections(namespace) will try
to do the same as before, but with a namespace (atom()). This is
useful for spliting different configurations values for the same variable
e.g. different environments.
The OS environment variables expected are:
- When no namespace is specified, then it'll be
$YGGDRASIL_RABBITMQ_SUBSCRIBER_CONNECTIONS. - When a namespace is specified e.g.
My.Custom.Namespace, then it'll be$MY_CUSTOM_NAMESPACE_YGGDRASIL_RABBITMQ_SUBSCRIBER_CONNECTIONS.
The expected application configuration would be as follows:
- Without namespace:
config :yggdrasil,
rabbitmq: [
subscriber_connections: :integer() # Defaults to 1
]
- With namespace e.g.
My.Custom.Namespace:
config :yggdrasil, My.Custom.Namespace,
rabbitmq: [
subscriber_connections: :integer() # Defaults to 1
]
subscriber_connections!(namespace \\ nil)
View Sourcesubscriber_connections!(Skogsra.Env.namespace()) :: {:ok, term()} | {:error, term()}
RabbitMQ amount of subscriber connections.
iex> Yggdrasil.Settings.RabbitMQ.subscriber_connections()
{:ok, 1}
Bang version of Yggdrasil.Settings.RabbitMQ.subscriber_connections/0 (fails on error).
username(namespace \\ nil)
View Sourceusername(Skogsra.Env.namespace()) :: {:ok, term()} | {:error, term()}
RabbitMQ username. Defaults to "guest".
iex> Yggdrasil.Settings.RabbitMQ.username()
{:ok, "guest"}
A call to Yggdrasil.Settings.RabbitMQ.username():
- When the OS environment variable is not
nil, then it'll return its casted value. - When the OS environment variable is
nil, then it'll try to get the value from the configuration file. - When the configuration file does not contain the variable, then it'll return the default value if it's defined.
- When the default value is not defined and it's not required, it'll
return
nil, otherwise it'll return an error.
A call to Yggdrasil.Settings.RabbitMQ.username(namespace) will try
to do the same as before, but with a namespace (atom()). This is
useful for spliting different configurations values for the same variable
e.g. different environments.
The OS environment variables expected are:
- When no namespace is specified, then it'll be
$YGGDRASIL_RABBITMQ_USERNAME. - When a namespace is specified e.g.
My.Custom.Namespace, then it'll be$MY_CUSTOM_NAMESPACE_YGGDRASIL_RABBITMQ_USERNAME.
The expected application configuration would be as follows:
- Without namespace:
config :yggdrasil,
rabbitmq: [
username: :binary() # Defaults to "guest"
]
- With namespace e.g.
My.Custom.Namespace:
config :yggdrasil, My.Custom.Namespace,
rabbitmq: [
username: :binary() # Defaults to "guest"
]
username!(namespace \\ nil)
View Sourceusername!(Skogsra.Env.namespace()) :: {:ok, term()} | {:error, term()}
RabbitMQ username. Defaults to "guest".
iex> Yggdrasil.Settings.RabbitMQ.username()
{:ok, "guest"}
Bang version of Yggdrasil.Settings.RabbitMQ.username/0 (fails on error).
virtual_host(namespace \\ nil)
View Sourcevirtual_host(Skogsra.Env.namespace()) :: {:ok, term()} | {:error, term()}
RabbitMQ virtual host. Defaults to "/".
iex> Yggdrasil.Settings.RabbitMQ.virtual_host()
{:ok, "/"}
A call to Yggdrasil.Settings.RabbitMQ.virtual_host():
- When the OS environment variable is not
nil, then it'll return its casted value. - When the OS environment variable is
nil, then it'll try to get the value from the configuration file. - When the configuration file does not contain the variable, then it'll return the default value if it's defined.
- When the default value is not defined and it's not required, it'll
return
nil, otherwise it'll return an error.
A call to Yggdrasil.Settings.RabbitMQ.virtual_host(namespace) will try
to do the same as before, but with a namespace (atom()). This is
useful for spliting different configurations values for the same variable
e.g. different environments.
The OS environment variables expected are:
- When no namespace is specified, then it'll be
$YGGDRASIL_RABBITMQ_VIRTUAL_HOST. - When a namespace is specified e.g.
My.Custom.Namespace, then it'll be$MY_CUSTOM_NAMESPACE_YGGDRASIL_RABBITMQ_VIRTUAL_HOST.
The expected application configuration would be as follows:
- Without namespace:
config :yggdrasil,
rabbitmq: [
virtual_host: :binary() # Defaults to "/"
]
- With namespace e.g.
My.Custom.Namespace:
config :yggdrasil, My.Custom.Namespace,
rabbitmq: [
virtual_host: :binary() # Defaults to "/"
]
virtual_host!(namespace \\ nil)
View Sourcevirtual_host!(Skogsra.Env.namespace()) :: {:ok, term()} | {:error, term()}
RabbitMQ virtual host. Defaults to "/".
iex> Yggdrasil.Settings.RabbitMQ.virtual_host()
{:ok, "/"}
Bang version of Yggdrasil.Settings.RabbitMQ.virtual_host/0 (fails on error).