Message queuing for Rust using apalis and AMQP.
apalis-amqp
is a Rust crate that provides utilities for integrating apalis
with AMQP message queuing systems. It includes an AmqpBackend
implementation for use with the pushing and popping jobs, as well as a JobStreamResult<J>
type for consuming messages from an AMQP queue and passing them to ReadyWorker
for processing.
tower
layers.Add apalis-amqp to your Cargo.toml file:
docker run -p 15672:15672 -p 5672:5672 -e RABBITMQ_DEFAULT_USER=apalis -e RABBITMQ_DEFAULT_PASS=apalis rabbitmq:3.8.4-management
toml
[dependencies]
apalis = "0.4.0-alpha.8"
apalis-amqp = "0.1"
serde = "1"
Then add to your main.rs
````rust use apalis::prelude::*; use apalis_amqp::AmqpBackend; use serde::{Deserialize, Serialize};
struct TestJob;
impl Job for TestJob { const NAME: &'static str = "TestJob"; }
async fn test_job(job: TestJob, ctx: JobContext) { dbg!(job); dbg!(ctx); }
async fn main() {
let env = std::env::var("AMQPADDR").unwrap();
let amqpbackend = AmqpBackend::
````
apalis-amqp is licensed under the Apache license. See the LICENSE file for details.