Make a fix for common queue timeout issue.
This commit is contained in:
2
Cargo.lock
generated
2
Cargo.lock
generated
@@ -3240,7 +3240,7 @@ checksum = "0c790de23124f9ab44544d7ac05d60440adc586479ce501c1d6d7da3cd8c9cf5"
|
||||
|
||||
[[package]]
|
||||
name = "slingshot-microservice"
|
||||
version = "0.1.0"
|
||||
version = "0.1.7"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"aws-config",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "slingshot-microservice"
|
||||
version = "0.1.0"
|
||||
version = "0.1.7"
|
||||
edition = "2021"
|
||||
description = "Opinionated Rust framework for queue-driven microservices"
|
||||
license = "MIT"
|
||||
|
||||
@@ -4,7 +4,7 @@ build-backend = "maturin"
|
||||
|
||||
[project]
|
||||
name = "slingshot-microservice"
|
||||
version = "0.1.6"
|
||||
version = "0.1.7"
|
||||
description = "Opinionated Rust framework for queue-driven microservices"
|
||||
license = { text = "MIT" }
|
||||
requires-python = ">=3.8"
|
||||
|
||||
@@ -20,6 +20,7 @@ use diesel::PgConnection;
|
||||
use futures_util::StreamExt;
|
||||
use lapin::options::{
|
||||
BasicAckOptions, BasicConsumeOptions, BasicNackOptions, BasicPublishOptions,
|
||||
BasicQosOptions,
|
||||
QueueDeclareOptions,
|
||||
};
|
||||
use tracing::{error, info};
|
||||
@@ -274,6 +275,11 @@ impl Microservice {
|
||||
.await
|
||||
.map_err(|e| format!("startup publish failed: {}", e))?;
|
||||
|
||||
channel
|
||||
.basic_qos(1, BasicQosOptions::default())
|
||||
.await
|
||||
.map_err(|e| format!("failed to set RabbitMQ consumer prefetch to 1: {}", e))?;
|
||||
|
||||
let mut consumer = channel
|
||||
.basic_consume(
|
||||
&inbound_queue,
|
||||
|
||||
Reference in New Issue
Block a user