Message Queue

RabbitMQ

Key Concepts There are three components defined by the AMQ model. Exchanges For routing messages to their proper destination is an [Exchange|Exchange]. An exchange receives messages sent into RabbitMQ and determines where to send them. Exchanges define routing behaviours that are applied to message. There are multiple exchange types, more on this later. Queues A queue is responsbile for storing received messages and may contain configuration information that defines what it is able to do with a message, and these messages are delivereed in a first-in-first-out order.

Rust and RabbitMQ

A very simple example Start Docker Container for RabbitMQ version: "3" services: rabbitmq: image: "rabbitmq:3-management" ports: - "5672:5672" - "15672:15672" volumes: - 'rabbitmq_data:/data' volumes: rabbitmq_data: Cargo.toml dependency Add the amqp dependency to the cargo.toml file [dependencies.amqp] version="0.1.3" Sample Code Import the crate to your application. In this instance, main.rs extern crate amqp; use amqp::Session; Simple Publish Function fn publish_message() -> () { use crate::amqp::Basic; let mut session = Session::open_url("amqp://localhost//").