use futures::StreamExt;
use iridium_stomp::{AckMode, Connection};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let conn = Connection::connect(
"127.0.0.1:61613",
"guest",
"guest",
Connection::DEFAULT_HEARTBEAT,
)
.await?;
let headers = vec![("example-header".to_string(), "value".to_string())];
let mut sub = conn
.subscribe_with_headers("/queue/example", AckMode::Client, headers)
.await?;
while let Some(frame) = sub.next().await {
println!("received frame:\n{}", frame);
}
Ok(())
}