Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

AMQP (Advanced Message Queueing Protocol) is an open protocol for asynchronous transfer of messages between applications on high speed with minimal delay

To maintain connection with external services via this protocol the RabbitMQ message broker is used. Message brokers create a two-way connection with each application system. Through this connection messages are transmitted, they are routed to corresponding destination points.

AMQP is based on three notions:

  • Message – is a unit of transmitted data, its main part (content) is not interpreted by the server in any way. Structured headings may be attached to the message.
  • Exchange – messages are directed into it. However messages are not stored in the exchange.
  • Queue – here the messages are stored until taken by the consumer. The consumer always takes the messages from one or several queues.

Processing sequence


  1. All messages, generated by the producer, are first accepted in the exchange.
  2. Here they are distributed between queues. Bindings are used to send messages to corresponding queues.
    • Sent messages remain in this queue until the consumer connects and receives the message.
  3. The consumer receives the message.
  4. Delivery verification mechanism is implemented in AMQP: a message is not removed from a queue until receipt confirmation is received from the consumer.
    • In case of negative response, the message may be resent or removed depending on producer's configuration settings during sending of the message.

Connecting to a queue


For integration and sending of messages through the RabbitMQ broker, set up a queue in the system:

  1. Navigate to External Queues → Rabbit providers.
  2. Click Create and fill in the required fields.
  3. Click Save or Save and Exit.

Field

Mandatory 

Description

Name

Y

Specify a name for created message queue. This queue name will be used to send messages from the API.

Host name

Y

Enter RabbitMQ host name to connect to, in the format example.ru.

Port

Y

Specify the server connection port.

Virtual host

N

Specify host designated in the RabbitMQ server settings.

Connection time out

N

Set the RabbitMQ server connection time out.

Username

Y

Specify user login for RabbitMQ server connection.

Password

Y

Specify user password for RabbitMQ server connection.

To send messages to the queue, create a message processing server script using the SimpleExternalRabbitMQ class.