Crate metalmq_client

source ·
Expand description

AMQP 0.9 compatible async client based on Tokio.

Usage

Add the following to your Cargo.toml

[dependencies]
metalmq-client = "0.2.2"

And then from an async function you can connect to an AMQP server.

use metalmq_client::Client;

async fn send_message() {
    let mut client = Client::connect("localhost:5672", "guest", "guest").await.unwrap();

    client.channel_open(1).await.unwrap();
    client.close().await.unwrap();
}

Macros

Shorthand for creating errors in async functions.

Structs

A channel is the main method of communicating with an AMQP server. Channels can be created on an open connection by calling the [Client.channel_open] function.
The AMQP client instance which reprensents an open connection.
Represents a connection or channel error. If channel is None it is a connection error.
Consumer API for Basic.Consume.
A message sent to the server or received from the server.
A delivered message.
Options for declaring exchanges.
Specify if the consume is exclusive aka no other client can consume the queue.
Condition for stating that queue can be deleted if it is empty, doesn’t have messages.
Condition for deleting an exchange or a queue if they don’t have active consumers.
Specify if the client needs to ack messages after delivery.
Specify if the server sends messages to the same connection which published them.
A message published by the client.
Builder style helper to specify options during queue declaration.
A message returned to the client.

Enums

Describe the queue binding.
A signal arriving from the server during consuming a queue.
Listening notifications sent by the server like channel closed or message publish acknowledged in confirm mode.
Represents the exchange binding type during Queue.Bind
Describe how many headers need to be matched in case of headers binding.

Type Definitions

AMQP channel number