Skip to content
This repository has been archived by the owner on Jul 23, 2024. It is now read-only.

Commit

Permalink
Declare chimp job queue when creating consumer
Browse files Browse the repository at this point in the history
  • Loading branch information
garryod committed Aug 9, 2023
1 parent 6dcf0d1 commit d14b171
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion chimp_chomp/src/jobs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use crate::{
use chimp_protocol::{Circle, Job, Response};
use futures::StreamExt;
use lapin::{
options::{BasicAckOptions, BasicConsumeOptions, BasicPublishOptions},
options::{BasicAckOptions, BasicConsumeOptions, BasicPublishOptions, QueueDeclareOptions},
types::FieldTable,
BasicProperties, Channel, Connection, Consumer,
};
Expand Down Expand Up @@ -33,6 +33,13 @@ pub async fn setup_job_consumer(
) -> Result<Consumer, lapin::Error> {
let worker_id = Uuid::new_v4();
let worker_tag = format!("chimp_chomp_{worker_id}");
rabbitmq_channel
.queue_declare(
channel.as_ref(),
QueueDeclareOptions::default(),
FieldTable::default(),
)
.await?;
rabbitmq_channel
.basic_consume(
channel.as_ref(),
Expand Down

0 comments on commit d14b171

Please sign in to comment.