azure_storage_queues

Crates.ioazure_storage_queues
lib.rsazure_storage_queues
version0.21.0
sourcesrc
created_at2022-01-25 20:30:52.402388
updated_at2024-10-15 22:44:13.592153
descriptionAzure Queue Storage crate from the Azure SDK for Rust
homepagehttps://github.com/azure/azure-sdk-for-rust/tree/legacy
repositoryhttps://github.com/azure/azure-sdk-for-rust
max_upload_size
id521053
size126,482
Heath Stewart (heaths)

documentation

https://docs.rs/azure_storage_queues

README

azure_storage_queues

Microsoft is developing the official Azure SDK for Rust crates and has no plans to update this unofficial crate. In the future we may release an official version that may have a different package name. If releasing an official version of this crate is important to you let us know.

Source for this crate can now be found in https://github.com/Azure/azure-sdk-for-rust/tree/legacy. To monitor for an official, supported version of this crate, see https://aka.ms/azsdk/releases.

The Azure Storage Queue crate

This crate is from the Azure SDK for Rust. It supports Azure Queue Storage.

Example

use azure_storage::prelude::*;
use azure_storage_queues::prelude::*;

#[tokio::main]
async fn main() -> azure_core::Result<()> {
    let account = std::env::var("STORAGE_ACCOUNT").expect("missing STORAGE_ACCOUNT");
    let access_key = std::env::var("STORAGE_ACCESS_KEY").expect("missing STORAGE_ACCESS_KEY");
    let queue_name = std::env::var("STORAGE_QUEUE_NAME").expect("missing STORAGE_QUEUE_NAME");

    let storage_credentials = StorageCredentials::access_key(account.clone(), access_key);
    let queue_service = QueueServiceClient::new(account, storage_credentials);
    let queue = queue_service.queue_client(queue_name);

    // process messages until there are no more
    loop {
        let response = queue.get_messages().await?;
        if response.messages.is_empty() {
            break;
        }
        for message in response.messages {
            println!("processing message {:?}", message);
            queue.pop_receipt_client(message).delete().await?;
        }
    }

    Ok(())
}

License: MIT

Commit count: 1916

cargo fmt