Creates an instance of QueueClient.
Account connection string or a SAS connection string of an Azure storage account.
[ Note - Account connection string can only be used in NODE.JS runtime. ]
Account connection string example -
DefaultEndpointsProtocol=https;AccountName=myaccount;AccountKey=accountKey;EndpointSuffix=core.windows.net
SAS connection string example -
BlobEndpoint=https://myaccount.blob.core.windows.net/;QueueEndpoint=https://myaccount.queue.core.windows.net/;FileEndpoint=https://myaccount.file.core.windows.net/;TableEndpoint=https://myaccount.table.core.windows.net/;SharedAccessSignature=sasString
Queue name.
Options to configure the HTTP pipeline.
Creates an instance of QueueClient.
A URL string pointing to Azure Storage queue, such as "https://myaccount.queue.core.windows.net/myqueue". You can append a SAS if using AnonymousCredential, such as "https://myaccount.queue.core.windows.net/myqueue?sasString".
Such as AnonymousCredential, StorageSharedKeyCredential or any credential from the @azure/identity
package to authenticate requests to the service. You can also provide an object that implements the TokenCredential interface. If not specified, AnonymousCredential is used.
Options to configure the HTTP pipeline.
Creates an instance of QueueClient.
A URL string pointing to Azure Storage queue, such as "https://myaccount.queue.core.windows.net/myqueue". You can append a SAS if using AnonymousCredential, such as "https://myaccount.queue.core.windows.net/myqueue?sasString".
Call newPipeline() to create a default pipeline, or provide a customized pipeline.
Credential factory in the pipleline to authenticate requests to the service, such as AnonymousCredential, StorageSharedKeyCredential. Initialized to an AnonymousCredential if not able to retrieve it from the pipeline.
Request policy pipeline.
StorageClientContext is a reference to protocol layer operations entry, which is generated by AutoRest generator.
URL string value.
The name of the queue.
Clear deletes all messages from a queue.
Options to clear messages operation.
Response data for the clear messages operation.
Creates a new queue under the specified account.
Options to Queue create operation.
Response data for the Queue create operation.
Example usage:
const queueClient = queueServiceClient.getQueueClient("<new queue name>");
const createQueueResponse = await queueClient.create();
Creates a new queue under the specified account if it doesn't already exist. If the queue already exists, it is not changed.
-
Deletes the specified queue permanently.
Options to Queue delete operation.
Response data for the Queue delete operation.
Example usage:
const deleteQueueResponse = await queueClient.delete();
console.log(
"Delete queue successfully, service assigned request Id:", deleteQueueResponse.requestId
);
Deletes the specified queue permanently if it exists.
-
deleteMessage permanently removes the specified message from its queue.
Id of the message.
A valid pop receipt value returned from an earlier call to the receive messages or update message operation.
Options to delete message operation.
Response data for the delete message operation.
Returns true if the specified queue exists; false otherwise.
NOTE: use this function with care since an existing queue might be deleted by other clients or applications. Vice versa new queues might be added by other clients or applications after this function completes.
options to Exists operation.
Only available for QueueClient constructed with a shared key credential.
Generates a Service Shared Access Signature (SAS) URI based on the client properties and parameters passed in. The SAS is signed by the shared key credential of the client.
Optional parameters.
The SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token.
Gets details about any stored access policies specified on the queue that may be used with Shared Access Signatures.
WARNING: JavaScript Date will potential lost precision when parsing start and expiry string. For example, new Date("2018-12-31T03:44:23.8827891Z").toISOString() will get "2018-12-31T03:44:23.882Z".
Options to Queue get access policy operation.
Response data for the Queue get access policy operation.
Gets all user-defined metadata and system properties for the specified queue. Metadata is associated with the queue as name-values pairs.
Options to Queue get properties operation.
Response data for the Queue get properties operation.
peekMessages retrieves one or more messages from the front of the queue but does not alter the visibility of the message.
Options to peek messages operation.
Response data for the peek messages operation.
Example usage:
const peekMessagesResponse = await queueClient.peekMessages();
console.log("The peeked message is:", peekMessagesResponse.peekedMessageItems[0].messageText);
receiveMessages retrieves one or more messages from the front of the queue.
Options to receive messages operation.
Response data for the receive messages operation.
Example usage:
const response = await queueClient.receiveMessages();
if (response.receivedMessageItems.length == 1) {
const receivedMessageItem = response.receivedMessageItems[0];
console.log("Processing & deleting message with content:", receivedMessageItem.messageText);
const deleteMessageResponse = await queueClient.deleteMessage(
receivedMessageItem.messageId,
receivedMessageItem.popReceipt
);
console.log(
"Delete message successfully, service assigned request Id:",
deleteMessageResponse.requestId
);
}
sendMessage adds a new message to the back of a queue. The visibility timeout specifies how long the message should be invisible to Dequeue and Peek operations. The message content is up to 64KB in size, and must be in a format that can be included in an XML request with UTF-8 encoding. To include markup in the message, the contents of the message must either be XML-escaped or Base64-encode.
Text of the message to send
Options to send messages operation.
Response data for the send messages operation.
Example usage:
const sendMessageResponse = await queueClient.sendMessage("Hello World!");
console.log(
"Sent message successfully, service assigned message Id:", sendMessageResponse.messageId,
"service assigned request Id:", sendMessageResponse.requestId
);
Sets stored access policies for the queue that may be used with Shared Access Signatures.
-
Options to Queue set access policy operation.
Response data for the Queue set access policy operation.
Sets one or more user-defined name-value pairs for the specified queue.
If no option provided, or no metadata defined in the option parameter, the queue metadata will be removed.
If no metadata provided, all existing metadata will be removed.
Options to Queue set metadata operation.
Response data for the Queue set metadata operation.
Update changes a message's visibility timeout and contents. The message content is up to 64KB in size, and must be in a format that can be included in an XML request with UTF-8 encoding. To include markup in the message, the contents of the message must either be XML-escaped or Base64-encode.
Id of the message
A valid pop receipt value returned from an earlier call to the receive messages or update message operation.
Message to update. If this parameter is undefined, then the content of the message won't be updated.
Specifies the new visibility timeout value, in seconds, relative to server time. The new value must be larger than or equal to 0, and cannot be larger than 7 days. The visibility timeout of a message cannot be set to a value later than the expiry time. A message can be updated until it has been deleted or has expired.
Options to update message operation.
Response data for the update message operation.
Generated using TypeDoc
A QueueClient represents a URL to an Azure Storage Queue's messages allowing you to manipulate its messages.