azeventhubs 0.20.0

An unofficial AMQP 1.0 rust client for Azure Event Hubs
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use azeventhubs::{EventHubConnection, EventHubConnectionOptions};

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let _ = dotenv::from_filename(".env");

    let connection_string = std::env::var("EVENT_HUBS_CONNECTION_STRING_WITH_ENTITY_PATH")?;
    let _event_hub_name = std::env::var("EVENT_HUB_NAME")?;
    let options = EventHubConnectionOptions::default();
    let connection =
        EventHubConnection::new_from_connection_string(connection_string, None, options).await?;
    connection.close().await?;

    Ok(())
}