QueueClient Class
Definition
This class provides a client that contains all the operations for interacting with a queue in Azure Storage Queue. Operations allowed by the client are creating and deleting the queue, retrieving and updating metadata and access policies of the queue, and enqueuing, dequeuing, peeking, updating, and deleting messages.
Instantiating an Synchronous Queue Client
QueueClient client = new QueueClientBuilder()
.connectionString("connectionstring")
.endpoint("endpoint")
.buildClient();
View QueueClientBuilder for additional ways to construct the client.
public final class QueueClient
- Inheritance
-
java.lang.ObjectQueueClient
Inherited Members
Methods
| clearMessages() |
Deletes all messages in the queue. Code Samples Clear the messages
For more information, see the Azure Docs. |
| clearMessagesWithResponse(Duration timeout, Context context) |
Deletes all messages in the queue. Code Samples Clear the messages
For more information, see the Azure Docs. |
| create() |
Creates a new queue. Code Samples Create a queue
For more information, see the Azure Docs. |
| createWithResponse(Map<String,String> metadata, Duration timeout, Context context) |
Creates a new queue. Code Samples Create a queue with metadata "queue:metadataMap"
For more information, see the Azure Docs. |
| delete() |
Permanently deletes the queue. Code Samples Delete a queue
For more information, see the Azure Docs. |
| deleteMessage(String messageId, String popReceipt) |
Deletes the specified message in the queue Code Samples Delete the first message
For more information, see the Azure Docs. |
| deleteMessageWithResponse(String messageId, String popReceipt, Duration timeout, Context context) |
Deletes the specified message in the queue Code Samples Delete the first message
For more information, see the Azure Docs. |
| deleteWithResponse(Duration timeout, Context context) |
Permanently deletes the queue. Code Samples Delete a queue
For more information, see the Azure Docs. |
| generateSas(QueueServiceSasSignatureValues queueServiceSasSignatureValues) |
Generates a service sas for the queue using the specified QueueServiceSasSignatureValues Note : The client must be authenticated via StorageSharedKeyCredential See QueueServiceSasSignatureValues for more information on how to construct a service SAS. Code Samples
|
| generateSas(QueueServiceSasSignatureValues queueServiceSasSignatureValues, Context context) |
Generates a service sas for the queue using the specified QueueServiceSasSignatureValues Note : The client must be authenticated via StorageSharedKeyCredential See QueueServiceSasSignatureValues for more information on how to construct a service SAS. Code Samples
|
| getAccessPolicy() |
Retrieves stored access policies specified on the queue. Code Samples List the stored access policies
For more information, see the Azure Docs. |
| getAccountName() |
Get associated account name. |
| getHttpPipeline() |
Gets the HttpPipeline powering this client. |
| getMessageEncoding() |
Gets the message encoding the client is using. |
| getProperties() |
Retrieves metadata and approximate message count of the queue. Code Samples Get the properties of the queue
For more information, see the Azure Docs. |
| getPropertiesWithResponse(Duration timeout, Context context) |
Retrieves metadata and approximate message count of the queue. Code Samples Get the properties of the queue
For more information, see the Azure Docs. |
| getQueueName() |
Get the queue name of the client. Code Samples
|
| getQueueUrl() | |
| getServiceVersion() |
Gets the service version the client is using. |
| peekMessage() |
Peeks the first message in the queue. Peeked messages don't contain the necessary information needed to interact with the message nor will it hide messages from other operations on the queue. Code Samples Peek the first message
For more information, see the Azure Docs. |
| peekMessages(Integer maxMessages, Duration timeout, Context context) |
Peek messages from the front of the queue up to the maximum number of messages. Peeked messages don't contain the necessary information needed to interact with the message nor will it hide messages from other operations on the queue. Code Samples Peek up to the first five messages
For more information, see the Azure Docs. |
| receiveMessage() |
Retrieves the first message in the queue and hides it from other operations for 30 seconds. Code Samples Receive a message
For more information, see the Azure Docs. |
| receiveMessages(Integer maxMessages) |
Retrieves up to the maximum number of messages from the queue and hides them from other operations for 30 seconds. Code Samples Receive up to 5 messages
For more information, see the Azure Docs. |
| receiveMessages(Integer maxMessages, Duration visibilityTimeout, Duration timeout, Context context) |
Retrieves up to the maximum number of messages from the queue and hides them from other operations for the timeout period. Code Samples Receive up to 5 messages and give them a 60 second timeout period
For more information, see the Azure Docs. |
| sendMessage(BinaryData message) |
Sends a message that has a time-to-live of 7 days and is instantly visible. Code Samples Sends a message of "Hello, Azure"
For more information, see the Azure Docs. |
| sendMessage(String messageText) |
Sends a message that has a time-to-live of 7 days and is instantly visible. Code Samples Sends a message of "Hello, Azure"
For more information, see the Azure Docs. |
| sendMessageWithResponse(BinaryData message, Duration visibilityTimeout, Duration timeToLive, Duration timeout, Context context) |
Sends a message with a given time-to-live and a timeout period where the message is invisible in the queue. Code Samples Add a message of "Hello, Azure" that has a timeout of 5 seconds
Add a message of "Goodbye, Azure" that has a time to live of 5 seconds
For more information, see the Azure Docs. |
| sendMessageWithResponse(String messageText, Duration visibilityTimeout, Duration timeToLive, Duration timeout, Context context) |
Sends a message with a given time-to-live and a timeout period where the message is invisible in the queue. Code Samples Add a message of "Hello, Azure" that has a timeout of 5 seconds
Add a message of "Goodbye, Azure" that has a time to live of 5 seconds
For more information, see the Azure Docs. |
| setAccessPolicy(List<QueueSignedIdentifier> permissions) |
Sets stored access policies on the queue. Code Samples Set a read only stored access policy
For more information, see the Azure Docs. |
| setAccessPolicyWithResponse(List<QueueSignedIdentifier> permissions, Duration timeout, Context context) |
Sets stored access policies on the queue. Code Samples Set a read only stored access policy
For more information, see the Azure Docs. |
| setMetadata(Map<String,String> metadata) |
Sets the metadata of the queue. Passing in a Code Samples Set the queue's metadata to "queue:metadataMap"
Clear the queue's metadata
For more information, see the Azure Docs. |
| setMetadataWithResponse(Map<String,String> metadata, Duration timeout, Context context) |
Sets the metadata of the queue. Passing in a Code Samples Set the queue's metadata to "queue:metadataMap"
Clear the queue's metadata
For more information, see the Azure Docs. |
| updateMessage(String messageId, String popReceipt, String messageText, Duration visibilityTimeout) |
Updates the specific message in the queue with a new message and resets the visibility timeout. Code Samples Dequeue the first message and update it to "Hello again, Azure" and hide it for 5 seconds
For more information, see the Azure Docs. |
| updateMessageWithResponse(String messageId, String popReceipt, String messageText, Duration visibilityTimeout, Duration timeout, Context context) |
Updates the specific message in the queue with a new message and resets the visibility timeout. Code Samples Dequeue the first message and update it to "Hello again, Azure" and hide it for 5 seconds
For more information, see the Azure Docs. |