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]]
|
[[package]]
|
||||||
name = "slingshot-microservice"
|
name = "slingshot-microservice"
|
||||||
version = "0.1.0"
|
version = "0.1.7"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"aws-config",
|
"aws-config",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "slingshot-microservice"
|
name = "slingshot-microservice"
|
||||||
version = "0.1.0"
|
version = "0.1.7"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
description = "Opinionated Rust framework for queue-driven microservices"
|
description = "Opinionated Rust framework for queue-driven microservices"
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ build-backend = "maturin"
|
|||||||
|
|
||||||
[project]
|
[project]
|
||||||
name = "slingshot-microservice"
|
name = "slingshot-microservice"
|
||||||
version = "0.1.6"
|
version = "0.1.7"
|
||||||
description = "Opinionated Rust framework for queue-driven microservices"
|
description = "Opinionated Rust framework for queue-driven microservices"
|
||||||
license = { text = "MIT" }
|
license = { text = "MIT" }
|
||||||
requires-python = ">=3.8"
|
requires-python = ">=3.8"
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ use diesel::PgConnection;
|
|||||||
use futures_util::StreamExt;
|
use futures_util::StreamExt;
|
||||||
use lapin::options::{
|
use lapin::options::{
|
||||||
BasicAckOptions, BasicConsumeOptions, BasicNackOptions, BasicPublishOptions,
|
BasicAckOptions, BasicConsumeOptions, BasicNackOptions, BasicPublishOptions,
|
||||||
|
BasicQosOptions,
|
||||||
QueueDeclareOptions,
|
QueueDeclareOptions,
|
||||||
};
|
};
|
||||||
use tracing::{error, info};
|
use tracing::{error, info};
|
||||||
@@ -274,6 +275,11 @@ impl Microservice {
|
|||||||
.await
|
.await
|
||||||
.map_err(|e| format!("startup publish failed: {}", e))?;
|
.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
|
let mut consumer = channel
|
||||||
.basic_consume(
|
.basic_consume(
|
||||||
&inbound_queue,
|
&inbound_queue,
|
||||||
|
|||||||
Reference in New Issue
Block a user