no more cargo advisories ignored
This commit is contained in:
@@ -161,7 +161,7 @@ impl Connection {
|
||||
pub async fn close(&self) -> MqResult<()> {
|
||||
let mut conn_guard = self.connection.write().await;
|
||||
if let Some(conn) = conn_guard.take() {
|
||||
conn.close(200, "Normal shutdown")
|
||||
conn.close(200, "Normal shutdown".into())
|
||||
.await
|
||||
.map_err(|e| MqError::Connection(format!("Failed to close connection: {}", e)))?;
|
||||
info!("Connection closed");
|
||||
@@ -187,7 +187,7 @@ impl Connection {
|
||||
|
||||
channel
|
||||
.exchange_declare(
|
||||
&config.name,
|
||||
config.name.as_str().into(),
|
||||
kind,
|
||||
ExchangeDeclareOptions {
|
||||
durable: config.durable,
|
||||
@@ -216,7 +216,7 @@ impl Connection {
|
||||
|
||||
channel
|
||||
.queue_declare(
|
||||
&config.name,
|
||||
config.name.as_str().into(),
|
||||
QueueDeclareOptions {
|
||||
durable: config.durable,
|
||||
exclusive: config.exclusive,
|
||||
@@ -248,9 +248,9 @@ impl Connection {
|
||||
|
||||
channel
|
||||
.queue_bind(
|
||||
queue,
|
||||
exchange,
|
||||
routing_key,
|
||||
queue.into(),
|
||||
exchange.into(),
|
||||
routing_key.into(),
|
||||
QueueBindOptions::default(),
|
||||
FieldTable::default(),
|
||||
)
|
||||
@@ -315,7 +315,7 @@ impl Connection {
|
||||
|
||||
channel
|
||||
.queue_declare(
|
||||
&config.name,
|
||||
config.name.as_str().into(),
|
||||
QueueDeclareOptions {
|
||||
durable: config.durable,
|
||||
exclusive: config.exclusive,
|
||||
|
||||
@@ -59,8 +59,8 @@ impl Consumer {
|
||||
let consumer = self
|
||||
.channel
|
||||
.basic_consume(
|
||||
&self.config.queue,
|
||||
&self.config.tag,
|
||||
self.config.queue.as_str().into(),
|
||||
self.config.tag.as_str().into(),
|
||||
BasicConsumeOptions {
|
||||
no_ack: self.config.auto_ack,
|
||||
exclusive: self.config.exclusive,
|
||||
|
||||
@@ -88,8 +88,8 @@ impl Publisher {
|
||||
let confirmation = self
|
||||
.channel
|
||||
.basic_publish(
|
||||
exchange,
|
||||
routing_key,
|
||||
exchange.into(),
|
||||
routing_key.into(),
|
||||
BasicPublishOptions::default(),
|
||||
&payload,
|
||||
properties,
|
||||
@@ -129,8 +129,8 @@ impl Publisher {
|
||||
|
||||
self.channel
|
||||
.basic_publish(
|
||||
exchange,
|
||||
routing_key,
|
||||
exchange.into(),
|
||||
routing_key.into(),
|
||||
BasicPublishOptions::default(),
|
||||
payload,
|
||||
properties,
|
||||
|
||||
@@ -61,7 +61,7 @@ impl RuleLifecycleListener {
|
||||
// Declare exchange (idempotent)
|
||||
channel
|
||||
.exchange_declare(
|
||||
&self.mq_exchange,
|
||||
self.mq_exchange.as_str().into(),
|
||||
lapin::ExchangeKind::Topic,
|
||||
ExchangeDeclareOptions {
|
||||
durable: true,
|
||||
@@ -78,7 +78,7 @@ impl RuleLifecycleListener {
|
||||
let queue_name = format!("sensor.{}", self.sensor_ref);
|
||||
channel
|
||||
.queue_declare(
|
||||
&queue_name,
|
||||
queue_name.as_str().into(),
|
||||
QueueDeclareOptions {
|
||||
durable: true,
|
||||
..Default::default()
|
||||
@@ -101,9 +101,9 @@ impl RuleLifecycleListener {
|
||||
for routing_key in &routing_keys {
|
||||
channel
|
||||
.queue_bind(
|
||||
&queue_name,
|
||||
&self.mq_exchange,
|
||||
routing_key,
|
||||
queue_name.as_str().into(),
|
||||
self.mq_exchange.as_str().into(),
|
||||
(*routing_key).into(),
|
||||
QueueBindOptions::default(),
|
||||
FieldTable::default(),
|
||||
)
|
||||
@@ -147,8 +147,8 @@ impl RuleLifecycleListener {
|
||||
// Start consuming messages
|
||||
let consumer = channel
|
||||
.basic_consume(
|
||||
&queue_name,
|
||||
"sensor-timer-consumer",
|
||||
queue_name.as_str().into(),
|
||||
"sensor-timer-consumer".into(),
|
||||
BasicConsumeOptions {
|
||||
no_ack: false,
|
||||
..Default::default()
|
||||
|
||||
@@ -62,7 +62,7 @@ impl RuleLifecycleListener {
|
||||
consumer
|
||||
.channel()
|
||||
.queue_declare(
|
||||
queue,
|
||||
queue.into(),
|
||||
lapin::options::QueueDeclareOptions {
|
||||
durable: true,
|
||||
exclusive: false,
|
||||
@@ -78,9 +78,9 @@ impl RuleLifecycleListener {
|
||||
consumer
|
||||
.channel()
|
||||
.queue_bind(
|
||||
queue,
|
||||
exchange,
|
||||
routing_key,
|
||||
queue.into(),
|
||||
exchange.into(),
|
||||
(*routing_key).into(),
|
||||
lapin::options::QueueBindOptions::default(),
|
||||
lapin::types::FieldTable::default(),
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user