RabbitMQ. Teil 1. Einführung. Erlang, AMQP

Guten Tag, Habr! Ich möchte ein Lehrbuch-Nachschlagewerk mit Wissen teilen, das ich gesammelt RabbitMQund zu kurzen Empfehlungen und Schlussfolgerungen komprimiert habe.


Inhaltsverzeichnis



Kurz über AMQP


AMQP (Advanced Message Queuing Protocol) ist ein offenes Protokoll zum Übertragen von Nachrichten zwischen Systemkomponenten. Die Hauptidee besteht darin, dass einzelne Subsysteme (oder unabhängige Anwendungen) Nachrichten auf beliebige Weise über einen AMQP-Broker austauschen können, der das Routing bereitstellt und möglicherweise die Zustellung, Verteilung von Datenströmen und das Abonnieren der erforderlichen Nachrichtentypen garantiert.

Das Protokoll AMQPführt drei Konzepte ein:


rabbitmq_1


  • exchange ( ) — . . (binding)
  • queue () — , consumers ().
  • binding () — , .

TCP/IP.


Erlang


GitHub. RabbitMQ-server Erlang BEAM.


Erlang Ericsson 1980-x , , , 99,999%. Erlang , WhatsApp. WhatsApp, Facebook $19

RabbitMQ


RabbitMQ – . AMQP . . RabbitMQ AMQP.


RabbitMQ , producer () . , - .


. , , — . , . ? ? .


Bild von: http://bit.ly/2U3PyJz


RabbitMQ :


  1. , ,
  2. .
  3. ,
  4. , , .

RPC


RPC (remote procedure call) RabbitMQ. , RabbitMQ, RPC. , RabbitMQ :


rabbitmq_2


AMQP . , . — . , Connection.StartStart Connection.



. . . , .


. Erlang . (multiplexing). . , RabbitMQ .


rabbitmq_3


RabbitMQ.Client:


// ...
private void TryConnect()
{
    var factory = new ConnectionFactory() 
    {
        HostName = "host_name",
        UserName = "user_name",
        Password = "p@ssword",
        //   
        //     
        AutomaticRecoveryEnabled = true
    };
    _connection = factory.CreateConnection();
}
// ...
public void CreateChannel()
{
    _channel = _connection.CreateModel();
    // other options 
}

, , . , , , .


RabbitMQ?


AMQP RabbitMQ .


IIOT AMQP RabbitMQ (-). MQTT Plugin RabbitMQ MQTT ( ).


Exchanges.




All Articles