Skip to content

Commit

Permalink
remove log messages
Browse files Browse the repository at this point in the history
  • Loading branch information
LockedThread committed Jul 25, 2024
1 parent 1d1f281 commit 920e667
Showing 1 changed file with 0 additions and 11 deletions.
11 changes: 0 additions & 11 deletions examples/src/basic_pub_sub.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ use amqprs::{
};
use tokio::time;

use tracing::info;
use tracing_subscriber::{fmt, prelude::*, EnvFilter};

#[tokio::main(flavor = "multi_thread", worker_threads = 2)]
Expand Down Expand Up @@ -68,14 +67,11 @@ async fn main() {
// start consumer with given name
let args = BasicConsumeArguments::new(&queue_name, "example_basic_pub_sub");

info!("before consuming");
channel
.basic_consume(DefaultConsumer::new(args.no_ack), args)
.await
.unwrap();

info!("after consuming");

//////////////////////////////////////////////////////////////////////////////
// publish message
let content = String::from(
Expand All @@ -91,23 +87,16 @@ async fn main() {
// create arguments for basic_publish
let args = BasicPublishArguments::new(exchange_name, routing_key);

info!("before publishing");
channel
.basic_publish(BasicProperties::default(), content, args)
.await
.unwrap();
info!("after publishing");

// keep the `channel` and `connection` object from dropping before pub/sub is done.
// channel/connection will be closed when drop.
info!("before sleeping");
time::sleep(time::Duration::from_secs(1)).await;
info!("after sleeping");
// explicitly close

info!(is_channel_open = channel.is_connection_open());
channel.close().await.unwrap();
info!("closed channel");
connection.close().await.unwrap();
info!("shutting down");
}

0 comments on commit 920e667

Please sign in to comment.