ex_aliyun_amqp v0.1.2 ExAliyunAMQP.Connection View Source

Simple wrapper for AMQP.Connection within Alibaba AMQP product's authorization.

Link to this section Summary

Functions

Closes an open Connection.

Similar as AMQP.Connection.open/2, but there are some options are different.

Prepare options of connection with Alibaba AMQP product's authorization, please see options of open/2 for details.

Link to this section Functions

Link to this function

close(connection)

View Source
close(AMQP.Connection.t()) :: :ok | {:error, any()}

Closes an open Connection.

Link to this function

open(options \\ [], name \\ :undefined)

View Source
open(keyword(), String.t() | :undefined) ::
  {:ok, AMQP.Connection.t()} | {:error, atom()} | {:error, any()}

Similar as AMQP.Connection.open/2, but there are some options are different.

Options

  • :access_id - The access_id of Alibaba resource access management for AMQP product, it is instead of username option (required);
  • :secret_key - The secret_key of Alibaba resource access management for AMQP product, it is instead of password option (required);
  • :owner_id - The id of Alibaba cloud account (required);
  • :host - The hostname of the Alibaba AMQP product broker (required);
  • :virtual_host - The name of a virtual host in the Alibaba AMQP product broker (required);
  • :port - The port the broker is listening on (defaults to 5672);
  • :channel_max - The channel_max handshake parameter (defaults to 0);
  • :frame_max - The frame_max handshake parameter (defaults to 0);
  • :heartbeat - The hearbeat interval in seconds (defaults to 10);
  • :connection_timeout - The connection timeout in milliseconds (defaults to 50000);
  • :ssl_options - Enable SSL by setting the location to cert files (defaults to :none);
  • :client_properties - A list of extra client properties to be sent to the server, defaults to [];
  • :socket_options - Extra socket options. These are appended to the default options. See http://www.erlang.org/doc/man/inet.html#setopts-2 and http://www.erlang.org/doc/man/gen_tcp.html#connect-4 for descriptions of the available options.
Link to this function

options(options)

View Source
options(keyword()) :: keyword()

Prepare options of connection with Alibaba AMQP product's authorization, please see options of open/2 for details.

The :access_id, :secret_key, :owner_id option are not AMQP connection starndard options, they are used to construct the required :username and :password option, to keep the returned options may used in other AMQP client initialization (e.g. BroadwayRabbitMQ.AmqpClient.init/1), these 3 options are not in the returned.