azure-docs-sdk-java/docs-ref-autogen/com.azure.storage.queue.Que...

598 строки
75 KiB
YAML

### YamlMime:JavaType
uid: "com.azure.storage.queue.QueueClient"
fullName: "com.azure.storage.queue.QueueClient"
name: "QueueClient"
nameWithType: "QueueClient"
summary: "This class provides a client that contains all the operations for interacting with a queue in Azure Storage Queue."
inheritances:
- "<xref href=\"java.lang.Object?displayProperty=fullName\" data-throw-if-not-resolved=\"False\" />"
inheritedClassMethods:
- classRef: "java.lang.<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html\">Object</a>"
methodsRef:
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#clone--\">clone</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals-java.lang.Object-\">equals</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#finalize--\">finalize</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass--\">getClass</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode--\">hashCode</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify--\">notify</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll--\">notifyAll</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString--\">toString</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait--\">wait</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-\">wait</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-int-\">wait</a>"
syntax: "public final class **QueueClient**"
methods:
- uid: "com.azure.storage.queue.QueueClient.clearMessages()"
fullName: "com.azure.storage.queue.QueueClient.clearMessages()"
name: "clearMessages()"
nameWithType: "QueueClient.clearMessages()"
summary: "Deletes all messages in the queue."
syntax: "public void clearMessages()"
desc: "Deletes all messages in the queue.\n\n**Code Samples**\n\nClear the messages\n\n```java\nclient.clearMessages();\n System.out.println(\"Clearing messages completed.\");\n```\n\nFor more information, see the [Azure Docs][].\n\n\n[Azure Docs]: https://docs.microsoft.com/rest/api/storageservices/clear-messages"
- uid: "com.azure.storage.queue.QueueClient.clearMessagesWithResponse(java.time.Duration,com.azure.core.util.Context)"
fullName: "com.azure.storage.queue.QueueClient.clearMessagesWithResponse(Duration timeout, Context context)"
name: "clearMessagesWithResponse(Duration timeout, Context context)"
nameWithType: "QueueClient.clearMessagesWithResponse(Duration timeout, Context context)"
summary: "Deletes all messages in the queue."
parameters:
- description: "An optional timeout applied to the operation. If a response is not returned before the timeout\n concludes a <xref uid=\"\" data-throw-if-not-resolved=\"false\" data-raw-source=\"RuntimeException\"></xref> will be thrown."
name: "timeout"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/time/Duration.html\">Duration</a>"
- description: "Additional context that is passed through the Http pipeline during the service call."
name: "context"
type: "<xref href=\"com.azure.core.util.Context?alt=com.azure.core.util.Context&text=Context\" data-throw-if-not-resolved=\"False\" />"
syntax: "public Response<Void> clearMessagesWithResponse(Duration timeout, Context context)"
desc: "Deletes all messages in the queue.\n\n**Code Samples**\n\nClear the messages\n\n```java\nResponse<Void> response = client.clearMessagesWithResponse(Duration.ofSeconds(1), new Context(key1, value1));\n System.out.printf(\"Clearing messages completed with status code %d\", response.getStatusCode());\n```\n\nFor more information, see the [Azure Docs][].\n\n\n[Azure Docs]: https://docs.microsoft.com/rest/api/storageservices/clear-messages"
returns:
description: "A response that only contains headers and response status code"
type: "<xref href=\"com.azure.core.http.rest.Response?alt=com.azure.core.http.rest.Response&text=Response\" data-throw-if-not-resolved=\"False\" />&lt;<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Void.html\">Void</a>&gt;"
- uid: "com.azure.storage.queue.QueueClient.create()"
fullName: "com.azure.storage.queue.QueueClient.create()"
name: "create()"
nameWithType: "QueueClient.create()"
summary: "Creates a new queue."
syntax: "public void create()"
desc: "Creates a new queue.\n\n**Code Samples**\n\nCreate a queue\n\n```java\nclient.create();\n System.out.println(\"Complete creating queue.\");\n```\n\nFor more information, see the [Azure Docs][].\n\n\n[Azure Docs]: https://docs.microsoft.com/rest/api/storageservices/create-queue4"
- uid: "com.azure.storage.queue.QueueClient.createIfNotExists()"
fullName: "com.azure.storage.queue.QueueClient.createIfNotExists()"
name: "createIfNotExists()"
nameWithType: "QueueClient.createIfNotExists()"
summary: "Creates a new queue if it does not exist."
syntax: "public boolean createIfNotExists()"
desc: "Creates a new queue if it does not exist.\n\n**Code Samples**\n\nCreate a queue\n\n```java\nboolean result = client.createIfNotExists();\n System.out.println(\"Queue created: \" + result);\n```\n\nFor more information, see the [Azure Docs][].\n\n\n[Azure Docs]: https://docs.microsoft.com/rest/api/storageservices/create-queue4"
returns:
description: "<code>true</code> if queue is successfully created, <code>false</code> if queue already exists."
type: "<xref href=\"boolean?alt=boolean&text=boolean\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.storage.queue.QueueClient.createIfNotExistsWithResponse(java.util.Map<java.lang.String,java.lang.String>,java.time.Duration,com.azure.core.util.Context)"
fullName: "com.azure.storage.queue.QueueClient.createIfNotExistsWithResponse(Map<String,String> metadata, Duration timeout, Context context)"
name: "createIfNotExistsWithResponse(Map<String,String> metadata, Duration timeout, Context context)"
nameWithType: "QueueClient.createIfNotExistsWithResponse(Map<String,String> metadata, Duration timeout, Context context)"
summary: "Creates a new queue if it does not exist."
parameters:
- description: "Metadata to associate with the queue. If there is leading or trailing whitespace in any\n metadata key or value, it must be removed or encoded."
name: "metadata"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/util/Map.html\">Map</a>&lt;<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>,<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>&gt;"
- description: "An optional timeout applied to the operation. If a response is not returned before the timeout\n concludes a <xref uid=\"\" data-throw-if-not-resolved=\"false\" data-raw-source=\"RuntimeException\"></xref> will be thrown."
name: "timeout"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/time/Duration.html\">Duration</a>"
- description: "Additional context that is passed through the Http pipeline during the service call."
name: "context"
type: "<xref href=\"com.azure.core.util.Context?alt=com.azure.core.util.Context&text=Context\" data-throw-if-not-resolved=\"False\" />"
syntax: "public Response<Boolean> createIfNotExistsWithResponse(Map<String,String> metadata, Duration timeout, Context context)"
desc: "Creates a new queue if it does not exist.\n\n**Code Samples**\n\nCreate a queue with metadata \"queue:metadataMap\"\n\n```java\nResponse<Boolean> response = client.createIfNotExistsWithResponse(Collections.singletonMap(\"queue\", \"metadataMap\"),\n Duration.ofSeconds(1), new Context(key1, value1));\n if (response.getStatusCode() == 409) {\n System.out.println(\"Already existed.\");\n } else {\n System.out.printf(\"Create completed with status %d%n\", response.getStatusCode());\n }\n```\n\nFor more information, see the [Azure Docs][].\n\n\n[Azure Docs]: https://docs.microsoft.com/rest/api/storageservices/create-queue4"
returns:
description: "A response containing status code and HTTP headers. If <xref uid=\"com.azure.core.http.rest.Response\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Response\"></xref>'s status code is 201, a new\n queue was successfully created. If status code is 204 or 409, a queue already existed at this location."
type: "<xref href=\"com.azure.core.http.rest.Response?alt=com.azure.core.http.rest.Response&text=Response\" data-throw-if-not-resolved=\"False\" />&lt;<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Boolean.html\">Boolean</a>&gt;"
- uid: "com.azure.storage.queue.QueueClient.createWithResponse(java.util.Map<java.lang.String,java.lang.String>,java.time.Duration,com.azure.core.util.Context)"
fullName: "com.azure.storage.queue.QueueClient.createWithResponse(Map<String,String> metadata, Duration timeout, Context context)"
name: "createWithResponse(Map<String,String> metadata, Duration timeout, Context context)"
nameWithType: "QueueClient.createWithResponse(Map<String,String> metadata, Duration timeout, Context context)"
summary: "Creates a new queue."
parameters:
- description: "Metadata to associate with the queue. If there is leading or trailing whitespace in any\n metadata key or value, it must be removed or encoded."
name: "metadata"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/util/Map.html\">Map</a>&lt;<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>,<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>&gt;"
- description: "An optional timeout applied to the operation. If a response is not returned before the timeout\n concludes a <xref uid=\"\" data-throw-if-not-resolved=\"false\" data-raw-source=\"RuntimeException\"></xref> will be thrown."
name: "timeout"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/time/Duration.html\">Duration</a>"
- description: "Additional context that is passed through the Http pipeline during the service call."
name: "context"
type: "<xref href=\"com.azure.core.util.Context?alt=com.azure.core.util.Context&text=Context\" data-throw-if-not-resolved=\"False\" />"
syntax: "public Response<Void> createWithResponse(Map<String,String> metadata, Duration timeout, Context context)"
desc: "Creates a new queue.\n\n**Code Samples**\n\nCreate a queue with metadata \"queue:metadataMap\"\n\n```java\nResponse<Void> response = client.createWithResponse(Collections.singletonMap(\"queue\", \"metadataMap\"),\n Duration.ofSeconds(1), new Context(key1, value1));\n System.out.println(\"Complete creating queue with status code: \" + response.getStatusCode());\n```\n\nFor more information, see the [Azure Docs][].\n\n\n[Azure Docs]: https://docs.microsoft.com/rest/api/storageservices/create-queue4"
returns:
description: "A response that only contains headers and response status code"
type: "<xref href=\"com.azure.core.http.rest.Response?alt=com.azure.core.http.rest.Response&text=Response\" data-throw-if-not-resolved=\"False\" />&lt;<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Void.html\">Void</a>&gt;"
- uid: "com.azure.storage.queue.QueueClient.delete()"
fullName: "com.azure.storage.queue.QueueClient.delete()"
name: "delete()"
nameWithType: "QueueClient.delete()"
summary: "Permanently deletes the queue."
syntax: "public void delete()"
desc: "Permanently deletes the queue.\n\n**Code Samples**\n\nDelete a queue\n\n```java\nclient.delete();\n System.out.println(\"Complete deleting the queue.\");\n```\n\nFor more information, see the [Azure Docs][].\n\n\n[Azure Docs]: https://docs.microsoft.com/rest/api/storageservices/delete-queue3"
- uid: "com.azure.storage.queue.QueueClient.deleteIfExists()"
fullName: "com.azure.storage.queue.QueueClient.deleteIfExists()"
name: "deleteIfExists()"
nameWithType: "QueueClient.deleteIfExists()"
summary: "Permanently deletes the queue if exists."
syntax: "public boolean deleteIfExists()"
desc: "Permanently deletes the queue if exists.\n\n**Code Samples**\n\nDelete a queue\n\n```java\nclient.deleteIfExists();\n System.out.println(\"Complete deleting the queue.\");\n```\n\nFor more information, see the [Azure Docs][].\n\n\n[Azure Docs]: https://docs.microsoft.com/rest/api/storageservices/delete-queue3"
returns:
description: "<code>true</code> if queue is successfully deleted, <code>false</code> if queue does not exist."
type: "<xref href=\"boolean?alt=boolean&text=boolean\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.storage.queue.QueueClient.deleteIfExistsWithResponse(java.time.Duration,com.azure.core.util.Context)"
fullName: "com.azure.storage.queue.QueueClient.deleteIfExistsWithResponse(Duration timeout, Context context)"
name: "deleteIfExistsWithResponse(Duration timeout, Context context)"
nameWithType: "QueueClient.deleteIfExistsWithResponse(Duration timeout, Context context)"
summary: "Permanently deletes the queue if it exists."
parameters:
- description: "An optional timeout applied to the operation. If a response is not returned before the timeout\n concludes a <xref uid=\"\" data-throw-if-not-resolved=\"false\" data-raw-source=\"RuntimeException\"></xref> will be thrown."
name: "timeout"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/time/Duration.html\">Duration</a>"
- description: "Additional context that is passed through the Http pipeline during the service call."
name: "context"
type: "<xref href=\"com.azure.core.util.Context?alt=com.azure.core.util.Context&text=Context\" data-throw-if-not-resolved=\"False\" />"
syntax: "public Response<Boolean> deleteIfExistsWithResponse(Duration timeout, Context context)"
desc: "Permanently deletes the queue if it exists.\n\n**Code Samples**\n\nDelete a queue\n\n```java\nResponse<Boolean> response = client.deleteIfExistsWithResponse(Duration.ofSeconds(1), new Context(key1, value1));\n if (response.getStatusCode() == 404) {\n System.out.println(\"Does not exist.\");\n } else {\n System.out.printf(\"Delete completed with status %d%n\", response.getStatusCode());\n }\n```\n\nFor more information, see the [Azure Docs][].\n\n\n[Azure Docs]: https://docs.microsoft.com/rest/api/storageservices/delete-queue3"
returns:
description: "A response containing status code and HTTP headers. If <xref uid=\"com.azure.core.http.rest.Response\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Response\"></xref>'s status code is 204, the queue\n was successfully deleted. If status code is 404, the queue does not exist."
type: "<xref href=\"com.azure.core.http.rest.Response?alt=com.azure.core.http.rest.Response&text=Response\" data-throw-if-not-resolved=\"False\" />&lt;<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Boolean.html\">Boolean</a>&gt;"
- uid: "com.azure.storage.queue.QueueClient.deleteMessage(java.lang.String,java.lang.String)"
fullName: "com.azure.storage.queue.QueueClient.deleteMessage(String messageId, String popReceipt)"
name: "deleteMessage(String messageId, String popReceipt)"
nameWithType: "QueueClient.deleteMessage(String messageId, String popReceipt)"
summary: "Deletes the specified message in the queue"
parameters:
- description: "Id of the message to deleted"
name: "messageId"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- description: "Unique identifier that must match for the message to be deleted"
name: "popReceipt"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
syntax: "public void deleteMessage(String messageId, String popReceipt)"
desc: "Deletes the specified message in the queue\n\n**Code Samples**\n\nDelete the first message\n\n```java\nQueueMessageItem queueMessageItem = client.receiveMessage();\n client.deleteMessage(queueMessageItem.getMessageId(), queueMessageItem.getPopReceipt());\n System.out.println(\"Complete deleting the message.\");\n```\n\nFor more information, see the [Azure Docs][].\n\n\n[Azure Docs]: https://docs.microsoft.com/rest/api/storageservices/delete-message2"
- uid: "com.azure.storage.queue.QueueClient.deleteMessageWithResponse(java.lang.String,java.lang.String,java.time.Duration,com.azure.core.util.Context)"
fullName: "com.azure.storage.queue.QueueClient.deleteMessageWithResponse(String messageId, String popReceipt, Duration timeout, Context context)"
name: "deleteMessageWithResponse(String messageId, String popReceipt, Duration timeout, Context context)"
nameWithType: "QueueClient.deleteMessageWithResponse(String messageId, String popReceipt, Duration timeout, Context context)"
summary: "Deletes the specified message in the queue"
parameters:
- description: "Id of the message to deleted"
name: "messageId"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- description: "Unique identifier that must match for the message to be deleted"
name: "popReceipt"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- description: "An optional timeout applied to the operation. If a response is not returned before the timeout\n concludes a <xref uid=\"\" data-throw-if-not-resolved=\"false\" data-raw-source=\"RuntimeException\"></xref> will be thrown."
name: "timeout"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/time/Duration.html\">Duration</a>"
- description: "Additional context that is passed through the Http pipeline during the service call."
name: "context"
type: "<xref href=\"com.azure.core.util.Context?alt=com.azure.core.util.Context&text=Context\" data-throw-if-not-resolved=\"False\" />"
syntax: "public Response<Void> deleteMessageWithResponse(String messageId, String popReceipt, Duration timeout, Context context)"
desc: "Deletes the specified message in the queue\n\n**Code Samples**\n\nDelete the first message\n\n```java\nQueueMessageItem queueMessageItem = client.receiveMessage();\n Response<Void> response = client.deleteMessageWithResponse(queueMessageItem.getMessageId(),\n queueMessageItem.getPopReceipt(), Duration.ofSeconds(1), new Context(key1, value1));\n System.out.println(\"Complete deleting the message with status code \" + response.getStatusCode());\n```\n\nFor more information, see the [Azure Docs][].\n\n\n[Azure Docs]: https://docs.microsoft.com/rest/api/storageservices/delete-message2"
returns:
description: "A response that only contains headers and response status code"
type: "<xref href=\"com.azure.core.http.rest.Response?alt=com.azure.core.http.rest.Response&text=Response\" data-throw-if-not-resolved=\"False\" />&lt;<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Void.html\">Void</a>&gt;"
- uid: "com.azure.storage.queue.QueueClient.deleteWithResponse(java.time.Duration,com.azure.core.util.Context)"
fullName: "com.azure.storage.queue.QueueClient.deleteWithResponse(Duration timeout, Context context)"
name: "deleteWithResponse(Duration timeout, Context context)"
nameWithType: "QueueClient.deleteWithResponse(Duration timeout, Context context)"
summary: "Permanently deletes the queue."
parameters:
- description: "An optional timeout applied to the operation. If a response is not returned before the timeout\n concludes a <xref uid=\"\" data-throw-if-not-resolved=\"false\" data-raw-source=\"RuntimeException\"></xref> will be thrown."
name: "timeout"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/time/Duration.html\">Duration</a>"
- description: "Additional context that is passed through the Http pipeline during the service call."
name: "context"
type: "<xref href=\"com.azure.core.util.Context?alt=com.azure.core.util.Context&text=Context\" data-throw-if-not-resolved=\"False\" />"
syntax: "public Response<Void> deleteWithResponse(Duration timeout, Context context)"
desc: "Permanently deletes the queue.\n\n**Code Samples**\n\nDelete a queue\n\n```java\nResponse<Void> response = client.deleteWithResponse(Duration.ofSeconds(1), new Context(key1, value1));\n System.out.println(\"Complete deleting the queue with status code: \" + response.getStatusCode());\n```\n\nFor more information, see the [Azure Docs][].\n\n\n[Azure Docs]: https://docs.microsoft.com/rest/api/storageservices/delete-queue3"
returns:
description: "A response that only contains headers and response status code"
type: "<xref href=\"com.azure.core.http.rest.Response?alt=com.azure.core.http.rest.Response&text=Response\" data-throw-if-not-resolved=\"False\" />&lt;<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Void.html\">Void</a>&gt;"
- uid: "com.azure.storage.queue.QueueClient.generateSas(com.azure.storage.queue.sas.QueueServiceSasSignatureValues)"
fullName: "com.azure.storage.queue.QueueClient.generateSas(QueueServiceSasSignatureValues queueServiceSasSignatureValues)"
name: "generateSas(QueueServiceSasSignatureValues queueServiceSasSignatureValues)"
nameWithType: "QueueClient.generateSas(QueueServiceSasSignatureValues queueServiceSasSignatureValues)"
summary: "Generates a service sas for the queue using the specified <xref uid=\"com.azure.storage.queue.sas.QueueServiceSasSignatureValues\" data-throw-if-not-resolved=\"false\" data-raw-source=\"QueueServiceSasSignatureValues\"></xref>"
parameters:
- description: "<xref uid=\"com.azure.storage.queue.sas.QueueServiceSasSignatureValues\" data-throw-if-not-resolved=\"false\" data-raw-source=\"QueueServiceSasSignatureValues\"></xref>"
name: "queueServiceSasSignatureValues"
type: "<xref href=\"com.azure.storage.queue.sas.QueueServiceSasSignatureValues?alt=com.azure.storage.queue.sas.QueueServiceSasSignatureValues&text=QueueServiceSasSignatureValues\" data-throw-if-not-resolved=\"False\" />"
syntax: "public String generateSas(QueueServiceSasSignatureValues queueServiceSasSignatureValues)"
desc: "Generates a service sas for the queue using the specified <xref uid=\"com.azure.storage.queue.sas.QueueServiceSasSignatureValues\" data-throw-if-not-resolved=\"false\" data-raw-source=\"QueueServiceSasSignatureValues\"></xref>\n\nNote : The client must be authenticated via <xref uid=\"\" data-throw-if-not-resolved=\"false\" data-raw-source=\"StorageSharedKeyCredential\"></xref>\n\nSee <xref uid=\"com.azure.storage.queue.sas.QueueServiceSasSignatureValues\" data-throw-if-not-resolved=\"false\" data-raw-source=\"QueueServiceSasSignatureValues\"></xref> for more information on how to construct a service SAS.\n\n**Code Samples**\n\n```java\nOffsetDateTime expiryTime = OffsetDateTime.now().plusDays(1);\n QueueSasPermission permission = new QueueSasPermission().setReadPermission(true);\n\n QueueServiceSasSignatureValues values = new QueueServiceSasSignatureValues(expiryTime, permission)\n .setStartTime(OffsetDateTime.now());\n\n client.generateSas(values); // Client must be authenticated via StorageSharedKeyCredential\n```"
returns:
description: "A <code>String</code> representing the SAS query parameters."
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- uid: "com.azure.storage.queue.QueueClient.generateSas(com.azure.storage.queue.sas.QueueServiceSasSignatureValues,com.azure.core.util.Context)"
fullName: "com.azure.storage.queue.QueueClient.generateSas(QueueServiceSasSignatureValues queueServiceSasSignatureValues, Context context)"
name: "generateSas(QueueServiceSasSignatureValues queueServiceSasSignatureValues, Context context)"
nameWithType: "QueueClient.generateSas(QueueServiceSasSignatureValues queueServiceSasSignatureValues, Context context)"
summary: "Generates a service sas for the queue using the specified <xref uid=\"com.azure.storage.queue.sas.QueueServiceSasSignatureValues\" data-throw-if-not-resolved=\"false\" data-raw-source=\"QueueServiceSasSignatureValues\"></xref>"
parameters:
- description: "<xref uid=\"com.azure.storage.queue.sas.QueueServiceSasSignatureValues\" data-throw-if-not-resolved=\"false\" data-raw-source=\"QueueServiceSasSignatureValues\"></xref>"
name: "queueServiceSasSignatureValues"
type: "<xref href=\"com.azure.storage.queue.sas.QueueServiceSasSignatureValues?alt=com.azure.storage.queue.sas.QueueServiceSasSignatureValues&text=QueueServiceSasSignatureValues\" data-throw-if-not-resolved=\"False\" />"
- description: "Additional context that is passed through the code when generating a SAS."
name: "context"
type: "<xref href=\"com.azure.core.util.Context?alt=com.azure.core.util.Context&text=Context\" data-throw-if-not-resolved=\"False\" />"
syntax: "public String generateSas(QueueServiceSasSignatureValues queueServiceSasSignatureValues, Context context)"
desc: "Generates a service sas for the queue using the specified <xref uid=\"com.azure.storage.queue.sas.QueueServiceSasSignatureValues\" data-throw-if-not-resolved=\"false\" data-raw-source=\"QueueServiceSasSignatureValues\"></xref>\n\nNote : The client must be authenticated via <xref uid=\"\" data-throw-if-not-resolved=\"false\" data-raw-source=\"StorageSharedKeyCredential\"></xref>\n\nSee <xref uid=\"com.azure.storage.queue.sas.QueueServiceSasSignatureValues\" data-throw-if-not-resolved=\"false\" data-raw-source=\"QueueServiceSasSignatureValues\"></xref> for more information on how to construct a service SAS.\n\n**Code Samples**\n\n```java\nOffsetDateTime expiryTime = OffsetDateTime.now().plusDays(1);\n QueueSasPermission permission = new QueueSasPermission().setReadPermission(true);\n\n QueueServiceSasSignatureValues values = new QueueServiceSasSignatureValues(expiryTime, permission)\n .setStartTime(OffsetDateTime.now());\n\n // Client must be authenticated via StorageSharedKeyCredential\n client.generateSas(values, new Context(\"key\", \"value\"));\n```"
returns:
description: "A <code>String</code> representing the SAS query parameters."
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- uid: "com.azure.storage.queue.QueueClient.getAccessPolicy()"
fullName: "com.azure.storage.queue.QueueClient.getAccessPolicy()"
name: "getAccessPolicy()"
nameWithType: "QueueClient.getAccessPolicy()"
summary: "Retrieves stored access policies specified on the queue."
syntax: "public PagedIterable<QueueSignedIdentifier> getAccessPolicy()"
desc: "Retrieves stored access policies specified on the queue.\n\n**Code Samples**\n\nList the stored access policies\n\n```java\nfor (QueueSignedIdentifier permission : client.getAccessPolicy()) {\n System.out.printf(\"Access policy %s allows these permissions: %s\", permission.getId(),\n permission.getAccessPolicy().getPermissions());\n }\n```\n\nFor more information, see the [Azure Docs][].\n\n\n[Azure Docs]: https://docs.microsoft.com/rest/api/storageservices/get-queue-acl"
returns:
description: "The stored access policies specified on the queue."
type: "<xref href=\"com.azure.core.http.rest.PagedIterable?alt=com.azure.core.http.rest.PagedIterable&text=PagedIterable\" data-throw-if-not-resolved=\"False\" />&lt;<xref href=\"com.azure.storage.queue.models.QueueSignedIdentifier?alt=com.azure.storage.queue.models.QueueSignedIdentifier&text=QueueSignedIdentifier\" data-throw-if-not-resolved=\"False\" />&gt;"
- uid: "com.azure.storage.queue.QueueClient.getAccountName()"
fullName: "com.azure.storage.queue.QueueClient.getAccountName()"
name: "getAccountName()"
nameWithType: "QueueClient.getAccountName()"
summary: "Get associated account name."
syntax: "public String getAccountName()"
desc: "Get associated account name."
returns:
description: "account name associated with this storage resource."
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- uid: "com.azure.storage.queue.QueueClient.getHttpPipeline()"
fullName: "com.azure.storage.queue.QueueClient.getHttpPipeline()"
name: "getHttpPipeline()"
nameWithType: "QueueClient.getHttpPipeline()"
summary: "Gets the <xref uid=\"com.azure.core.http.HttpPipeline\" data-throw-if-not-resolved=\"false\" data-raw-source=\"HttpPipeline\"></xref> powering this client."
syntax: "public HttpPipeline getHttpPipeline()"
desc: "Gets the <xref uid=\"com.azure.core.http.HttpPipeline\" data-throw-if-not-resolved=\"false\" data-raw-source=\"HttpPipeline\"></xref> powering this client."
returns:
description: "The pipeline."
type: "<xref href=\"com.azure.core.http.HttpPipeline?alt=com.azure.core.http.HttpPipeline&text=HttpPipeline\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.storage.queue.QueueClient.getMessageEncoding()"
fullName: "com.azure.storage.queue.QueueClient.getMessageEncoding()"
name: "getMessageEncoding()"
nameWithType: "QueueClient.getMessageEncoding()"
summary: "Gets the message encoding the client is using."
syntax: "public QueueMessageEncoding getMessageEncoding()"
desc: "Gets the message encoding the client is using."
returns:
description: "the message encoding the client is using."
type: "<xref href=\"com.azure.storage.queue.QueueMessageEncoding?alt=com.azure.storage.queue.QueueMessageEncoding&text=QueueMessageEncoding\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.storage.queue.QueueClient.getProperties()"
fullName: "com.azure.storage.queue.QueueClient.getProperties()"
name: "getProperties()"
nameWithType: "QueueClient.getProperties()"
summary: "Retrieves metadata and approximate message count of the queue."
syntax: "public QueueProperties getProperties()"
desc: "Retrieves metadata and approximate message count of the queue.\n\n**Code Samples**\n\nGet the properties of the queue\n\n```java\nQueueProperties properties = client.getProperties();\n System.out.printf(\"Metadata: %s, Approximate message count: %d\", properties.getMetadata(),\n properties.getApproximateMessagesCount());\n```\n\nFor more information, see the [Azure Docs][].\n\n\n[Azure Docs]: https://docs.microsoft.com/rest/api/storageservices/get-queue-metadata"
returns:
description: "A response containing a <xref uid=\"com.azure.storage.queue.models.QueueProperties\" data-throw-if-not-resolved=\"false\" data-raw-source=\"QueueProperties\"></xref> value which contains the metadata and approximate\n messages count of the queue."
type: "<xref href=\"com.azure.storage.queue.models.QueueProperties?alt=com.azure.storage.queue.models.QueueProperties&text=QueueProperties\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.storage.queue.QueueClient.getPropertiesWithResponse(java.time.Duration,com.azure.core.util.Context)"
fullName: "com.azure.storage.queue.QueueClient.getPropertiesWithResponse(Duration timeout, Context context)"
name: "getPropertiesWithResponse(Duration timeout, Context context)"
nameWithType: "QueueClient.getPropertiesWithResponse(Duration timeout, Context context)"
summary: "Retrieves metadata and approximate message count of the queue."
parameters:
- description: "An optional timeout applied to the operation. If a response is not returned before the timeout\n concludes a <xref uid=\"\" data-throw-if-not-resolved=\"false\" data-raw-source=\"RuntimeException\"></xref> will be thrown."
name: "timeout"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/time/Duration.html\">Duration</a>"
- description: "Additional context that is passed through the Http pipeline during the service call."
name: "context"
type: "<xref href=\"com.azure.core.util.Context?alt=com.azure.core.util.Context&text=Context\" data-throw-if-not-resolved=\"False\" />"
syntax: "public Response<QueueProperties> getPropertiesWithResponse(Duration timeout, Context context)"
desc: "Retrieves metadata and approximate message count of the queue.\n\n**Code Samples**\n\nGet the properties of the queue\n\n```java\nQueueProperties properties = client.getPropertiesWithResponse(Duration.ofSeconds(1),\n new Context(key1, value1)).getValue();\n System.out.printf(\"Metadata: %s, Approximate message count: %d\", properties.getMetadata(),\n properties.getApproximateMessagesCount());\n```\n\nFor more information, see the [Azure Docs][].\n\n\n[Azure Docs]: https://docs.microsoft.com/rest/api/storageservices/get-queue-metadata"
returns:
description: "A response containing a <xref uid=\"com.azure.storage.queue.models.QueueProperties\" data-throw-if-not-resolved=\"false\" data-raw-source=\"QueueProperties\"></xref> value which contains the metadata and approximate\n messages count of the queue."
type: "<xref href=\"com.azure.core.http.rest.Response?alt=com.azure.core.http.rest.Response&text=Response\" data-throw-if-not-resolved=\"False\" />&lt;<xref href=\"com.azure.storage.queue.models.QueueProperties?alt=com.azure.storage.queue.models.QueueProperties&text=QueueProperties\" data-throw-if-not-resolved=\"False\" />&gt;"
- uid: "com.azure.storage.queue.QueueClient.getQueueName()"
fullName: "com.azure.storage.queue.QueueClient.getQueueName()"
name: "getQueueName()"
nameWithType: "QueueClient.getQueueName()"
summary: "Get the queue name of the client."
syntax: "public String getQueueName()"
desc: "Get the queue name of the client.\n\n**Code Samples**\n\n```java\nString queueName = client.getQueueName();\n System.out.println(\"The name of the queue is \" + queueName);\n```"
returns:
description: "The name of the queue."
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- uid: "com.azure.storage.queue.QueueClient.getQueueUrl()"
fullName: "com.azure.storage.queue.QueueClient.getQueueUrl()"
name: "getQueueUrl()"
nameWithType: "QueueClient.getQueueUrl()"
summary: "Get the URL of the storage queue."
syntax: "public String getQueueUrl()"
desc: "Get the URL of the storage queue."
returns:
description: "the URL of the storage queue."
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- uid: "com.azure.storage.queue.QueueClient.getServiceVersion()"
fullName: "com.azure.storage.queue.QueueClient.getServiceVersion()"
name: "getServiceVersion()"
nameWithType: "QueueClient.getServiceVersion()"
summary: "Gets the service version the client is using."
syntax: "public QueueServiceVersion getServiceVersion()"
desc: "Gets the service version the client is using."
returns:
description: "the service version the client is using."
type: "<xref href=\"com.azure.storage.queue.QueueServiceVersion?alt=com.azure.storage.queue.QueueServiceVersion&text=QueueServiceVersion\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.storage.queue.QueueClient.peekMessage()"
fullName: "com.azure.storage.queue.QueueClient.peekMessage()"
name: "peekMessage()"
nameWithType: "QueueClient.peekMessage()"
summary: "Peeks the first message in the queue."
syntax: "public PeekedMessageItem peekMessage()"
desc: "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.\n\n**Code Samples**\n\nPeek the first message\n\n```java\nPeekedMessageItem peekedMessageItem = client.peekMessage();\n System.out.println(\"Complete peeking the message: \" + peekedMessageItem.getBody().toString());\n```\n\nFor more information, see the [Azure Docs][].\n\n\n[Azure Docs]: https://docs.microsoft.com/rest/api/storageservices/peek-messages"
returns:
description: "A <xref uid=\"com.azure.storage.queue.models.PeekedMessageItem\" data-throw-if-not-resolved=\"false\" data-raw-source=\"PeekedMessageItem\"></xref> that contains metadata about the message."
type: "<xref href=\"com.azure.storage.queue.models.PeekedMessageItem?alt=com.azure.storage.queue.models.PeekedMessageItem&text=PeekedMessageItem\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.storage.queue.QueueClient.peekMessages(java.lang.Integer,java.time.Duration,com.azure.core.util.Context)"
fullName: "com.azure.storage.queue.QueueClient.peekMessages(Integer maxMessages, Duration timeout, Context context)"
name: "peekMessages(Integer maxMessages, Duration timeout, Context context)"
nameWithType: "QueueClient.peekMessages(Integer maxMessages, Duration timeout, Context context)"
summary: "Peek messages from the front of the queue up to the maximum number of messages."
parameters:
- description: "Optional. Maximum number of messages to peek, if there are less messages exist in the queue\n than requested all the messages will be peeked. If left empty only 1 message will be peeked, the allowed range is\n 1 to 32 messages."
name: "maxMessages"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Integer.html\">Integer</a>"
- description: "An optional timeout applied to the operation. If a response is not returned before the timeout\n concludes a <xref uid=\"\" data-throw-if-not-resolved=\"false\" data-raw-source=\"RuntimeException\"></xref> will be thrown."
name: "timeout"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/time/Duration.html\">Duration</a>"
- description: "Additional context that is passed through the Http pipeline during the service call."
name: "context"
type: "<xref href=\"com.azure.core.util.Context?alt=com.azure.core.util.Context&text=Context\" data-throw-if-not-resolved=\"False\" />"
syntax: "public PagedIterable<PeekedMessageItem> peekMessages(Integer maxMessages, Duration timeout, Context context)"
desc: "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.\n\n**Code Samples**\n\nPeek up to the first five messages\n\n```java\nclient.peekMessages(5, Duration.ofSeconds(1), new Context(key1, value1)).forEach(\n peekMessage -> System.out.printf(\"Peeked message %s has been received %d times\",\n peekMessage.getMessageId(), peekMessage.getDequeueCount())\n );\n```\n\nFor more information, see the [Azure Docs][].\n\n\n[Azure Docs]: https://docs.microsoft.com/rest/api/storageservices/peek-messages"
returns:
description: "Up to <code>maxMessages</code> <xref uid=\"com.azure.storage.queue.models.PeekedMessageItem\" data-throw-if-not-resolved=\"false\" data-raw-source=\"PeekedMessages\"></xref> from the queue. Each PeekedMessage\n contains metadata about the message."
type: "<xref href=\"com.azure.core.http.rest.PagedIterable?alt=com.azure.core.http.rest.PagedIterable&text=PagedIterable\" data-throw-if-not-resolved=\"False\" />&lt;<xref href=\"com.azure.storage.queue.models.PeekedMessageItem?alt=com.azure.storage.queue.models.PeekedMessageItem&text=PeekedMessageItem\" data-throw-if-not-resolved=\"False\" />&gt;"
- uid: "com.azure.storage.queue.QueueClient.receiveMessage()"
fullName: "com.azure.storage.queue.QueueClient.receiveMessage()"
name: "receiveMessage()"
nameWithType: "QueueClient.receiveMessage()"
summary: "Retrieves the first message in the queue and hides it from other operations for 30 seconds."
syntax: "public QueueMessageItem receiveMessage()"
desc: "Retrieves the first message in the queue and hides it from other operations for 30 seconds.\n\n**Code Samples**\n\nReceive a message\n\n```java\nQueueMessageItem queueMessageItem = client.receiveMessage();\n System.out.println(\"Complete receiving the message: \" + queueMessageItem.getMessageId());\n```\n\nFor more information, see the [Azure Docs][].\n\n\n[Azure Docs]: https://docs.microsoft.com/rest/api/storageservices/get-messages"
returns:
description: "The first <xref uid=\"com.azure.storage.queue.models.QueueMessageItem\" data-throw-if-not-resolved=\"false\" data-raw-source=\"MessageItem\"></xref> in the queue, it contains\n <xref uid=\"com.azure.storage.queue.models.QueueMessageItem.getMessageId()\" data-throw-if-not-resolved=\"false\" data-raw-source=\"messageId\"></xref> and\n <xref uid=\"com.azure.storage.queue.models.QueueMessageItem.getPopReceipt()\" data-throw-if-not-resolved=\"false\" data-raw-source=\"popReceipt\"></xref> used to interact with the message,\n additionally it contains other metadata about the message."
type: "<xref href=\"com.azure.storage.queue.models.QueueMessageItem?alt=com.azure.storage.queue.models.QueueMessageItem&text=QueueMessageItem\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.storage.queue.QueueClient.receiveMessages(java.lang.Integer)"
fullName: "com.azure.storage.queue.QueueClient.receiveMessages(Integer maxMessages)"
name: "receiveMessages(Integer maxMessages)"
nameWithType: "QueueClient.receiveMessages(Integer maxMessages)"
summary: "Retrieves up to the maximum number of messages from the queue and hides them from other operations for 30 seconds."
parameters:
- description: "Optional. Maximum number of messages to get, if there are less messages exist in the queue\n than requested all the messages will be returned. If left empty only 1 message will be retrieved, the allowed\n range is 1 to 32 messages."
name: "maxMessages"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Integer.html\">Integer</a>"
syntax: "public PagedIterable<QueueMessageItem> receiveMessages(Integer maxMessages)"
desc: "Retrieves up to the maximum number of messages from the queue and hides them from other operations for 30 seconds.\n\n**Code Samples**\n\nReceive up to 5 messages\n\n```java\nfor (QueueMessageItem message : client.receiveMessages(5)) {\n System.out.printf(\"Received %s and it becomes visible at %s\",\n message.getMessageId(), message.getTimeNextVisible());\n }\n```\n\nFor more information, see the [Azure Docs][].\n\n\n[Azure Docs]: https://docs.microsoft.com/rest/api/storageservices/get-messages"
returns:
description: "Up to <code>maxMessages</code> <xref uid=\"com.azure.storage.queue.models.QueueMessageItem\" data-throw-if-not-resolved=\"false\" data-raw-source=\"ReceiveMessageItem\"></xref> from the queue.\n Each ReceiveMessageItem contains <xref uid=\"com.azure.storage.queue.models.QueueMessageItem.getMessageId()\" data-throw-if-not-resolved=\"false\" data-raw-source=\"messageId\"></xref> and\n <xref uid=\"com.azure.storage.queue.models.QueueMessageItem.getPopReceipt()\" data-throw-if-not-resolved=\"false\" data-raw-source=\"popReceipt\"></xref>\n used to interact with the message and other metadata about the message."
type: "<xref href=\"com.azure.core.http.rest.PagedIterable?alt=com.azure.core.http.rest.PagedIterable&text=PagedIterable\" data-throw-if-not-resolved=\"False\" />&lt;<xref href=\"com.azure.storage.queue.models.QueueMessageItem?alt=com.azure.storage.queue.models.QueueMessageItem&text=QueueMessageItem\" data-throw-if-not-resolved=\"False\" />&gt;"
- uid: "com.azure.storage.queue.QueueClient.receiveMessages(java.lang.Integer,java.time.Duration,java.time.Duration,com.azure.core.util.Context)"
fullName: "com.azure.storage.queue.QueueClient.receiveMessages(Integer maxMessages, Duration visibilityTimeout, Duration timeout, Context context)"
name: "receiveMessages(Integer maxMessages, Duration visibilityTimeout, Duration timeout, Context context)"
nameWithType: "QueueClient.receiveMessages(Integer maxMessages, Duration visibilityTimeout, Duration timeout, Context context)"
summary: "Retrieves up to the maximum number of messages from the queue and hides them from other operations for the timeout period."
parameters:
- description: "Optional. Maximum number of messages to get, if there are less messages exist in the queue\n than requested all the messages will be returned. If left empty only 1 message will be retrieved, the allowed\n range is 1 to 32 messages."
name: "maxMessages"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Integer.html\">Integer</a>"
- description: "Optional. The timeout period for how long the message is invisible in the queue. If left\n empty the received messages will be invisible for 30 seconds. The timeout must be between 1 second and 7 days."
name: "visibilityTimeout"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/time/Duration.html\">Duration</a>"
- description: "An optional timeout applied to the operation. If a response is not returned before the timeout\n concludes a <xref uid=\"\" data-throw-if-not-resolved=\"false\" data-raw-source=\"RuntimeException\"></xref> will be thrown."
name: "timeout"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/time/Duration.html\">Duration</a>"
- description: "Additional context that is passed through the Http pipeline during the service call."
name: "context"
type: "<xref href=\"com.azure.core.util.Context?alt=com.azure.core.util.Context&text=Context\" data-throw-if-not-resolved=\"False\" />"
syntax: "public PagedIterable<QueueMessageItem> receiveMessages(Integer maxMessages, Duration visibilityTimeout, Duration timeout, Context context)"
desc: "Retrieves up to the maximum number of messages from the queue and hides them from other operations for the timeout period.\n\n**Code Samples**\n\nReceive up to 5 messages and give them a 60 second timeout period\n\n```java\nfor (QueueMessageItem message : client.receiveMessages(5, Duration.ofSeconds(60),\n Duration.ofSeconds(1), new Context(key1, value1))) {\n System.out.printf(\"Received %s and it becomes visible at %s\",\n message.getMessageId(), message.getTimeNextVisible());\n }\n```\n\nFor more information, see the [Azure Docs][].\n\n\n[Azure Docs]: https://docs.microsoft.com/rest/api/storageservices/get-messages"
returns:
description: "Up to <code>maxMessages</code> <xref uid=\"com.azure.storage.queue.models.QueueMessageItem\" data-throw-if-not-resolved=\"false\" data-raw-source=\"DequeuedMessages\"></xref> from the queue. Each DeqeuedMessage\n contains <xref uid=\"com.azure.storage.queue.models.QueueMessageItem.getMessageId()\" data-throw-if-not-resolved=\"false\" data-raw-source=\"messageId\"></xref> and\n <xref uid=\"com.azure.storage.queue.models.QueueMessageItem.getPopReceipt()\" data-throw-if-not-resolved=\"false\" data-raw-source=\"popReceipt\"></xref>\n used to interact with the message and other metadata about the message."
type: "<xref href=\"com.azure.core.http.rest.PagedIterable?alt=com.azure.core.http.rest.PagedIterable&text=PagedIterable\" data-throw-if-not-resolved=\"False\" />&lt;<xref href=\"com.azure.storage.queue.models.QueueMessageItem?alt=com.azure.storage.queue.models.QueueMessageItem&text=QueueMessageItem\" data-throw-if-not-resolved=\"False\" />&gt;"
- uid: "com.azure.storage.queue.QueueClient.sendMessage(com.azure.core.util.BinaryData)"
fullName: "com.azure.storage.queue.QueueClient.sendMessage(BinaryData message)"
name: "sendMessage(BinaryData message)"
nameWithType: "QueueClient.sendMessage(BinaryData message)"
summary: "Sends a message that has a time-to-live of 7 days and is instantly visible."
parameters:
- description: "Message content"
name: "message"
type: "<xref href=\"com.azure.core.util.BinaryData?alt=com.azure.core.util.BinaryData&text=BinaryData\" data-throw-if-not-resolved=\"False\" />"
syntax: "public SendMessageResult sendMessage(BinaryData message)"
desc: "Sends a message that has a time-to-live of 7 days and is instantly visible.\n\n**Code Samples**\n\nSends a message of \"Hello, Azure\"\n\n```java\nSendMessageResult response = client.sendMessage(BinaryData.fromString(\"Hello msg\"));\n System.out.println(\"Complete enqueuing the message with message Id\" + response.getMessageId());\n```\n\nFor more information, see the [Azure Docs][].\n\n\n[Azure Docs]: https://docs.microsoft.com/rest/api/storageservices/put-message"
returns:
description: "A <xref uid=\"com.azure.storage.queue.models.SendMessageResult\" data-throw-if-not-resolved=\"false\" data-raw-source=\"SendMessageResult\"></xref> value that contains the <xref uid=\"com.azure.storage.queue.models.SendMessageResult.getMessageId()\" data-throw-if-not-resolved=\"false\" data-raw-source=\"messageId\"></xref>\n and <xref uid=\"com.azure.storage.queue.models.SendMessageResult.getPopReceipt()\" data-throw-if-not-resolved=\"false\" data-raw-source=\"popReceipt\"></xref> that are used to interact with the message\n and other metadata about the enqueued message."
type: "<xref href=\"com.azure.storage.queue.models.SendMessageResult?alt=com.azure.storage.queue.models.SendMessageResult&text=SendMessageResult\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.storage.queue.QueueClient.sendMessage(java.lang.String)"
fullName: "com.azure.storage.queue.QueueClient.sendMessage(String messageText)"
name: "sendMessage(String messageText)"
nameWithType: "QueueClient.sendMessage(String messageText)"
summary: "Sends a message that has a time-to-live of 7 days and is instantly visible."
parameters:
- description: "Message text"
name: "messageText"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
syntax: "public SendMessageResult sendMessage(String messageText)"
desc: "Sends a message that has a time-to-live of 7 days and is instantly visible.\n\n**Code Samples**\n\nSends a message of \"Hello, Azure\"\n\n```java\nSendMessageResult response = client.sendMessage(\"hello msg\");\n System.out.println(\"Complete enqueuing the message with message Id\" + response.getMessageId());\n```\n\nFor more information, see the [Azure Docs][].\n\n\n[Azure Docs]: https://docs.microsoft.com/rest/api/storageservices/put-message"
returns:
description: "A <xref uid=\"com.azure.storage.queue.models.SendMessageResult\" data-throw-if-not-resolved=\"false\" data-raw-source=\"SendMessageResult\"></xref> value that contains the <xref uid=\"com.azure.storage.queue.models.SendMessageResult.getMessageId()\" data-throw-if-not-resolved=\"false\" data-raw-source=\"messageId\"></xref>\n and <xref uid=\"com.azure.storage.queue.models.SendMessageResult.getPopReceipt()\" data-throw-if-not-resolved=\"false\" data-raw-source=\"popReceipt\"></xref> that are used to interact with the message\n and other metadata about the enqueued message."
type: "<xref href=\"com.azure.storage.queue.models.SendMessageResult?alt=com.azure.storage.queue.models.SendMessageResult&text=SendMessageResult\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.storage.queue.QueueClient.sendMessageWithResponse(com.azure.core.util.BinaryData,java.time.Duration,java.time.Duration,java.time.Duration,com.azure.core.util.Context)"
fullName: "com.azure.storage.queue.QueueClient.sendMessageWithResponse(BinaryData message, Duration visibilityTimeout, Duration timeToLive, Duration timeout, Context context)"
name: "sendMessageWithResponse(BinaryData message, Duration visibilityTimeout, Duration timeToLive, Duration timeout, Context context)"
nameWithType: "QueueClient.sendMessageWithResponse(BinaryData message, Duration visibilityTimeout, Duration timeToLive, Duration timeout, Context context)"
summary: "Sends a message with a given time-to-live and a timeout period where the message is invisible in the queue."
parameters:
- description: "Message content"
name: "message"
type: "<xref href=\"com.azure.core.util.BinaryData?alt=com.azure.core.util.BinaryData&text=BinaryData\" data-throw-if-not-resolved=\"False\" />"
- description: "Optional. The timeout period for how long the message is invisible in the queue. If\n unset the value will default to 0 and the message will be instantly visible. The timeout must be between 0\n seconds and 7 days."
name: "visibilityTimeout"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/time/Duration.html\">Duration</a>"
- description: "Optional. How long the message will stay alive in the queue. If unset the value will default to\n 7 days, if <code>Duration.ofSeconds(-1)</code> is passed the message will not expire.\n The time to live must be <code>Duration.ofSeconds(-1)</code> or any positive number of seconds."
name: "timeToLive"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/time/Duration.html\">Duration</a>"
- description: "An optional timeout applied to the operation. If a response is not returned before the timeout\n concludes a <xref uid=\"\" data-throw-if-not-resolved=\"false\" data-raw-source=\"RuntimeException\"></xref> will be thrown."
name: "timeout"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/time/Duration.html\">Duration</a>"
- description: "Additional context that is passed through the Http pipeline during the service call."
name: "context"
type: "<xref href=\"com.azure.core.util.Context?alt=com.azure.core.util.Context&text=Context\" data-throw-if-not-resolved=\"False\" />"
syntax: "public Response<SendMessageResult> sendMessageWithResponse(BinaryData message, Duration visibilityTimeout, Duration timeToLive, Duration timeout, Context context)"
desc: "Sends a message with a given time-to-live and a timeout period where the message is invisible in the queue.\n\n**Code Samples**\n\nAdd a message of \"Hello, Azure\" that has a timeout of 5 seconds\n\n```java\nSendMessageResult sentMessageItem = client.sendMessageWithResponse(BinaryData.fromString(\"Hello, Azure\"),\n Duration.ofSeconds(5), null, Duration.ofSeconds(1), new Context(key1, value1)).getValue();\n System.out.printf(\"Message %s expires at %s\", sentMessageItem.getMessageId(),\n sentMessageItem.getExpirationTime());\n```\n\nAdd a message of \"Goodbye, Azure\" that has a time to live of 5 seconds\n\n```java\nSendMessageResult enqueuedMessage = client.sendMessageWithResponse(BinaryData.fromString(\"Goodbye, Azure\"),\n null, Duration.ofSeconds(5), Duration.ofSeconds(1), new Context(key1, value1)).getValue();\n System.out.printf(\"Message %s expires at %s\", enqueuedMessage.getMessageId(),\n enqueuedMessage.getExpirationTime());\n```\n\nFor more information, see the [Azure Docs][].\n\n\n[Azure Docs]: https://docs.microsoft.com/rest/api/storageservices/put-message"
returns:
description: "A response containing the <xref uid=\"com.azure.storage.queue.models.SendMessageResult\" data-throw-if-not-resolved=\"false\" data-raw-source=\"SendMessageResult\"></xref> value that contains the\n <xref uid=\"com.azure.storage.queue.models.SendMessageResult.getMessageId()\" data-throw-if-not-resolved=\"false\" data-raw-source=\"messageId\"></xref> and\n <xref uid=\"com.azure.storage.queue.models.SendMessageResult.getPopReceipt()\" data-throw-if-not-resolved=\"false\" data-raw-source=\"popReceipt\"></xref> that are used to\n interact with the message and other metadata about the enqueued message."
type: "<xref href=\"com.azure.core.http.rest.Response?alt=com.azure.core.http.rest.Response&text=Response\" data-throw-if-not-resolved=\"False\" />&lt;<xref href=\"com.azure.storage.queue.models.SendMessageResult?alt=com.azure.storage.queue.models.SendMessageResult&text=SendMessageResult\" data-throw-if-not-resolved=\"False\" />&gt;"
- uid: "com.azure.storage.queue.QueueClient.sendMessageWithResponse(java.lang.String,java.time.Duration,java.time.Duration,java.time.Duration,com.azure.core.util.Context)"
fullName: "com.azure.storage.queue.QueueClient.sendMessageWithResponse(String messageText, Duration visibilityTimeout, Duration timeToLive, Duration timeout, Context context)"
name: "sendMessageWithResponse(String messageText, Duration visibilityTimeout, Duration timeToLive, Duration timeout, Context context)"
nameWithType: "QueueClient.sendMessageWithResponse(String messageText, Duration visibilityTimeout, Duration timeToLive, Duration timeout, Context context)"
summary: "Sends a message with a given time-to-live and a timeout period where the message is invisible in the queue."
parameters:
- description: "Message text"
name: "messageText"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- description: "Optional. The timeout period for how long the message is invisible in the queue. If\n unset the value will default to 0 and the message will be instantly visible. The timeout must be between 0\n seconds and 7 days."
name: "visibilityTimeout"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/time/Duration.html\">Duration</a>"
- description: "Optional. How long the message will stay alive in the queue. If unset the value will default to\n 7 days, if <code>Duration.ofSeconds(-1)</code> is passed the message will not expire.\n The time to live must be <code>Duration.ofSeconds(-1)</code> or any positive number of seconds."
name: "timeToLive"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/time/Duration.html\">Duration</a>"
- description: "An optional timeout applied to the operation. If a response is not returned before the timeout\n concludes a <xref uid=\"\" data-throw-if-not-resolved=\"false\" data-raw-source=\"RuntimeException\"></xref> will be thrown."
name: "timeout"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/time/Duration.html\">Duration</a>"
- description: "Additional context that is passed through the Http pipeline during the service call."
name: "context"
type: "<xref href=\"com.azure.core.util.Context?alt=com.azure.core.util.Context&text=Context\" data-throw-if-not-resolved=\"False\" />"
syntax: "public Response<SendMessageResult> sendMessageWithResponse(String messageText, Duration visibilityTimeout, Duration timeToLive, Duration timeout, Context context)"
desc: "Sends a message with a given time-to-live and a timeout period where the message is invisible in the queue.\n\n**Code Samples**\n\nAdd a message of \"Hello, Azure\" that has a timeout of 5 seconds\n\n```java\nSendMessageResult sentMessageItem = client.sendMessageWithResponse(\"Hello, Azure\",\n Duration.ofSeconds(5), null, Duration.ofSeconds(1), new Context(key1, value1)).getValue();\n System.out.printf(\"Message %s expires at %s\", sentMessageItem.getMessageId(),\n sentMessageItem.getExpirationTime());\n```\n\nAdd a message of \"Goodbye, Azure\" that has a time to live of 5 seconds\n\n```java\nSendMessageResult enqueuedMessage = client.sendMessageWithResponse(\"Goodbye, Azure\",\n null, Duration.ofSeconds(5), Duration.ofSeconds(1), new Context(key1, value1)).getValue();\n System.out.printf(\"Message %s expires at %s\", enqueuedMessage.getMessageId(),\n enqueuedMessage.getExpirationTime());\n```\n\nFor more information, see the [Azure Docs][].\n\n\n[Azure Docs]: https://docs.microsoft.com/rest/api/storageservices/put-message"
returns:
description: "A response containing the <xref uid=\"com.azure.storage.queue.models.SendMessageResult\" data-throw-if-not-resolved=\"false\" data-raw-source=\"SendMessageResult\"></xref> value that contains the\n <xref uid=\"com.azure.storage.queue.models.SendMessageResult.getMessageId()\" data-throw-if-not-resolved=\"false\" data-raw-source=\"messageId\"></xref> and\n <xref uid=\"com.azure.storage.queue.models.SendMessageResult.getPopReceipt()\" data-throw-if-not-resolved=\"false\" data-raw-source=\"popReceipt\"></xref> that are used to\n interact with the message and other metadata about the enqueued message."
type: "<xref href=\"com.azure.core.http.rest.Response?alt=com.azure.core.http.rest.Response&text=Response\" data-throw-if-not-resolved=\"False\" />&lt;<xref href=\"com.azure.storage.queue.models.SendMessageResult?alt=com.azure.storage.queue.models.SendMessageResult&text=SendMessageResult\" data-throw-if-not-resolved=\"False\" />&gt;"
- uid: "com.azure.storage.queue.QueueClient.setAccessPolicy(java.util.List<com.azure.storage.queue.models.QueueSignedIdentifier>)"
fullName: "com.azure.storage.queue.QueueClient.setAccessPolicy(List<QueueSignedIdentifier> permissions)"
name: "setAccessPolicy(List<QueueSignedIdentifier> permissions)"
nameWithType: "QueueClient.setAccessPolicy(List<QueueSignedIdentifier> permissions)"
summary: "Sets stored access policies on the queue."
parameters:
- description: "Access policies to set on the queue"
name: "permissions"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/util/List.html\">List</a>&lt;<xref href=\"com.azure.storage.queue.models.QueueSignedIdentifier?alt=com.azure.storage.queue.models.QueueSignedIdentifier&text=QueueSignedIdentifier\" data-throw-if-not-resolved=\"False\" />&gt;"
syntax: "public void setAccessPolicy(List<QueueSignedIdentifier> permissions)"
desc: "Sets stored access policies on the queue.\n\n**Code Samples**\n\nSet a read only stored access policy\n\n```java\nQueueAccessPolicy accessPolicy = new QueueAccessPolicy().setPermissions(\"r\")\n .setStartsOn(OffsetDateTime.now(ZoneOffset.UTC))\n .setExpiresOn(OffsetDateTime.now(ZoneOffset.UTC).plusDays(10));\n QueueSignedIdentifier permission = new QueueSignedIdentifier().setId(\"mypolicy\").setAccessPolicy(accessPolicy);\n client.setAccessPolicy(Collections.singletonList(permission));\n System.out.println(\"Setting access policies completed.\");\n```\n\nFor more information, see the [Azure Docs][].\n\n\n[Azure Docs]: https://docs.microsoft.com/rest/api/storageservices/set-queue-acl"
- uid: "com.azure.storage.queue.QueueClient.setAccessPolicyWithResponse(java.util.List<com.azure.storage.queue.models.QueueSignedIdentifier>,java.time.Duration,com.azure.core.util.Context)"
fullName: "com.azure.storage.queue.QueueClient.setAccessPolicyWithResponse(List<QueueSignedIdentifier> permissions, Duration timeout, Context context)"
name: "setAccessPolicyWithResponse(List<QueueSignedIdentifier> permissions, Duration timeout, Context context)"
nameWithType: "QueueClient.setAccessPolicyWithResponse(List<QueueSignedIdentifier> permissions, Duration timeout, Context context)"
summary: "Sets stored access policies on the queue."
parameters:
- description: "Access policies to set on the queue"
name: "permissions"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/util/List.html\">List</a>&lt;<xref href=\"com.azure.storage.queue.models.QueueSignedIdentifier?alt=com.azure.storage.queue.models.QueueSignedIdentifier&text=QueueSignedIdentifier\" data-throw-if-not-resolved=\"False\" />&gt;"
- description: "An optional timeout applied to the operation. If a response is not returned before the timeout\n concludes a <xref uid=\"\" data-throw-if-not-resolved=\"false\" data-raw-source=\"RuntimeException\"></xref> will be thrown."
name: "timeout"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/time/Duration.html\">Duration</a>"
- description: "Additional context that is passed through the Http pipeline during the service call."
name: "context"
type: "<xref href=\"com.azure.core.util.Context?alt=com.azure.core.util.Context&text=Context\" data-throw-if-not-resolved=\"False\" />"
syntax: "public Response<Void> setAccessPolicyWithResponse(List<QueueSignedIdentifier> permissions, Duration timeout, Context context)"
desc: "Sets stored access policies on the queue.\n\n**Code Samples**\n\nSet a read only stored access policy\n\n```java\nQueueAccessPolicy accessPolicy = new QueueAccessPolicy().setPermissions(\"r\")\n .setStartsOn(OffsetDateTime.now(ZoneOffset.UTC))\n .setExpiresOn(OffsetDateTime.now(ZoneOffset.UTC).plusDays(10));\n QueueSignedIdentifier permission = new QueueSignedIdentifier().setId(\"mypolicy\").setAccessPolicy(accessPolicy);\n Response<Void> response = client.setAccessPolicyWithResponse(Collections.singletonList(permission),\n Duration.ofSeconds(1), new Context(key1, value1));\n System.out.printf(\"Setting access policies completed with status code %d\", response.getStatusCode());\n```\n\nFor more information, see the [Azure Docs][].\n\n\n[Azure Docs]: https://docs.microsoft.com/rest/api/storageservices/set-queue-acl"
returns:
description: "A response that only contains headers and response status code"
type: "<xref href=\"com.azure.core.http.rest.Response?alt=com.azure.core.http.rest.Response&text=Response\" data-throw-if-not-resolved=\"False\" />&lt;<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Void.html\">Void</a>&gt;"
- uid: "com.azure.storage.queue.QueueClient.setMetadata(java.util.Map<java.lang.String,java.lang.String>)"
fullName: "com.azure.storage.queue.QueueClient.setMetadata(Map<String,String> metadata)"
name: "setMetadata(Map<String,String> metadata)"
nameWithType: "QueueClient.setMetadata(Map<String,String> metadata)"
summary: "Sets the metadata of the queue."
parameters:
- description: "Metadata to set on the queue"
name: "metadata"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/util/Map.html\">Map</a>&lt;<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>,<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>&gt;"
syntax: "public void setMetadata(Map<String,String> metadata)"
desc: "Sets the metadata of the queue. Passing in a `null` value for metadata will clear the metadata associated with the queue.\n\n**Code Samples**\n\nSet the queue's metadata to \"queue:metadataMap\"\n\n```java\nclient.setMetadata(Collections.singletonMap(\"queue\", \"metadataMap\"));\n System.out.println(\"Setting metadata completed.\");\n```\n\nClear the queue's metadata\n\n```java\nclient.setMetadata(null);\n System.out.println(\"Clearing metadata completed.\");\n```\n\nFor more information, see the [Azure Docs][].\n\n\n[Azure Docs]: https://docs.microsoft.com/rest/api/storageservices/set-queue-metadata"
- uid: "com.azure.storage.queue.QueueClient.setMetadataWithResponse(java.util.Map<java.lang.String,java.lang.String>,java.time.Duration,com.azure.core.util.Context)"
fullName: "com.azure.storage.queue.QueueClient.setMetadataWithResponse(Map<String,String> metadata, Duration timeout, Context context)"
name: "setMetadataWithResponse(Map<String,String> metadata, Duration timeout, Context context)"
nameWithType: "QueueClient.setMetadataWithResponse(Map<String,String> metadata, Duration timeout, Context context)"
summary: "Sets the metadata of the queue."
parameters:
- description: "Metadata to set on the queue"
name: "metadata"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/util/Map.html\">Map</a>&lt;<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>,<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>&gt;"
- description: "An optional timeout applied to the operation. If a response is not returned before the timeout\n concludes a <xref uid=\"\" data-throw-if-not-resolved=\"false\" data-raw-source=\"RuntimeException\"></xref> will be thrown."
name: "timeout"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/time/Duration.html\">Duration</a>"
- description: "Additional context that is passed through the Http pipeline during the service call."
name: "context"
type: "<xref href=\"com.azure.core.util.Context?alt=com.azure.core.util.Context&text=Context\" data-throw-if-not-resolved=\"False\" />"
syntax: "public Response<Void> setMetadataWithResponse(Map<String,String> metadata, Duration timeout, Context context)"
desc: "Sets the metadata of the queue. Passing in a `null` value for metadata will clear the metadata associated with the queue.\n\n**Code Samples**\n\nSet the queue's metadata to \"queue:metadataMap\"\n\n```java\nclient.setMetadataWithResponse(Collections.singletonMap(\"queue\", \"metadataMap\"),\n Duration.ofSeconds(1), new Context(key1, value1));\n System.out.println(\"Setting metadata completed.\");\n```\n\nClear the queue's metadata\n\n```java\nResponse<Void> response = client.setMetadataWithResponse(null, Duration.ofSeconds(1),\n new Context(key1, value1));\n System.out.printf(\"Clearing metadata completed with status code %d\", response.getStatusCode());\n```\n\nFor more information, see the [Azure Docs][].\n\n\n[Azure Docs]: https://docs.microsoft.com/rest/api/storageservices/set-queue-metadata"
returns:
description: "A response that only contains headers and response status code"
type: "<xref href=\"com.azure.core.http.rest.Response?alt=com.azure.core.http.rest.Response&text=Response\" data-throw-if-not-resolved=\"False\" />&lt;<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Void.html\">Void</a>&gt;"
- uid: "com.azure.storage.queue.QueueClient.updateMessage(java.lang.String,java.lang.String,java.lang.String,java.time.Duration)"
fullName: "com.azure.storage.queue.QueueClient.updateMessage(String messageId, String popReceipt, String messageText, Duration visibilityTimeout)"
name: "updateMessage(String messageId, String popReceipt, String messageText, Duration visibilityTimeout)"
nameWithType: "QueueClient.updateMessage(String messageId, String popReceipt, String messageText, Duration visibilityTimeout)"
summary: "Updates the specific message in the queue with a new message and resets the visibility timeout."
parameters:
- description: "Id of the message to update"
name: "messageId"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- description: "Unique identifier that must match for the message to be updated"
name: "popReceipt"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- description: "Updated value for the message"
name: "messageText"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- description: "The timeout period for how long the message is invisible in the queue in seconds. The\n timeout period must be between 1 second and 7 days. The default value is Duration.ZERO."
name: "visibilityTimeout"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/time/Duration.html\">Duration</a>"
syntax: "public UpdateMessageResult updateMessage(String messageId, String popReceipt, String messageText, Duration visibilityTimeout)"
desc: "Updates the specific message in the queue with a new message and resets the visibility timeout.\n\n**Code Samples**\n\nDequeue the first message and update it to \"Hello again, Azure\" and hide it for 5 seconds\n\n```java\nQueueMessageItem queueMessageItem = client.receiveMessage();\n UpdateMessageResult result = client.updateMessage(queueMessageItem.getMessageId(),\n queueMessageItem.getPopReceipt(), \"newText\", null);\n System.out.println(\"Complete updating the message with the receipt \" + result.getPopReceipt());\n```\n\nFor more information, see the [Azure Docs][].\n\n\n[Azure Docs]: https://docs.microsoft.com/rest/api/storageservices/update-message"
returns:
description: "A <xref uid=\"com.azure.storage.queue.models.UpdateMessageResult\" data-throw-if-not-resolved=\"false\" data-raw-source=\"UpdateMessageResult\"></xref> that contains the new\n <xref uid=\"com.azure.storage.queue.models.UpdateMessageResult.getPopReceipt()\" data-throw-if-not-resolved=\"false\" data-raw-source=\"popReceipt\"></xref> to interact with the message,\n additionally contains the updated metadata about the message."
type: "<xref href=\"com.azure.storage.queue.models.UpdateMessageResult?alt=com.azure.storage.queue.models.UpdateMessageResult&text=UpdateMessageResult\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.storage.queue.QueueClient.updateMessageWithResponse(java.lang.String,java.lang.String,java.lang.String,java.time.Duration,java.time.Duration,com.azure.core.util.Context)"
fullName: "com.azure.storage.queue.QueueClient.updateMessageWithResponse(String messageId, String popReceipt, String messageText, Duration visibilityTimeout, Duration timeout, Context context)"
name: "updateMessageWithResponse(String messageId, String popReceipt, String messageText, Duration visibilityTimeout, Duration timeout, Context context)"
nameWithType: "QueueClient.updateMessageWithResponse(String messageId, String popReceipt, String messageText, Duration visibilityTimeout, Duration timeout, Context context)"
summary: "Updates the specific message in the queue with a new message and resets the visibility timeout."
parameters:
- description: "Id of the message to update"
name: "messageId"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- description: "Unique identifier that must match for the message to be updated"
name: "popReceipt"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- description: "Updated value for the message"
name: "messageText"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- description: "The timeout period for how long the message is invisible in the queue in seconds. The\n timeout period must be between 1 second and 7 days. The default value is Duration.ZERO."
name: "visibilityTimeout"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/time/Duration.html\">Duration</a>"
- description: "An optional timeout applied to the operation. If a response is not returned before the timeout\n concludes a <xref uid=\"\" data-throw-if-not-resolved=\"false\" data-raw-source=\"RuntimeException\"></xref> will be thrown."
name: "timeout"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/time/Duration.html\">Duration</a>"
- description: "Additional context that is passed through the Http pipeline during the service call."
name: "context"
type: "<xref href=\"com.azure.core.util.Context?alt=com.azure.core.util.Context&text=Context\" data-throw-if-not-resolved=\"False\" />"
syntax: "public Response<UpdateMessageResult> updateMessageWithResponse(String messageId, String popReceipt, String messageText, Duration visibilityTimeout, Duration timeout, Context context)"
desc: "Updates the specific message in the queue with a new message and resets the visibility timeout.\n\n**Code Samples**\n\nDequeue the first message and update it to \"Hello again, Azure\" and hide it for 5 seconds\n\n```java\nQueueMessageItem queueMessageItem = client.receiveMessage();\n Response<UpdateMessageResult> response = client.updateMessageWithResponse(queueMessageItem.getMessageId(),\n queueMessageItem.getPopReceipt(), \"newText\", null, Duration.ofSeconds(1),\n new Context(key1, value1));\n System.out.println(\"Complete updating the message with status code \" + response.getStatusCode());\n```\n\nFor more information, see the [Azure Docs][].\n\n\n[Azure Docs]: https://docs.microsoft.com/rest/api/storageservices/update-message"
returns:
description: "A response containing the <xref uid=\"com.azure.storage.queue.models.UpdateMessageResult\" data-throw-if-not-resolved=\"false\" data-raw-source=\"UpdateMessageResult\"></xref> that contains the new <xref uid=\"com.azure.storage.queue.models.UpdateMessageResult.getPopReceipt()\" data-throw-if-not-resolved=\"false\" data-raw-source=\"popReceipt\"></xref> to interact with the message, additionally contains the updated\n metadata about the message."
type: "<xref href=\"com.azure.core.http.rest.Response?alt=com.azure.core.http.rest.Response&text=Response\" data-throw-if-not-resolved=\"False\" />&lt;<xref href=\"com.azure.storage.queue.models.UpdateMessageResult?alt=com.azure.storage.queue.models.UpdateMessageResult&text=UpdateMessageResult\" data-throw-if-not-resolved=\"False\" />&gt;"
type: "class"
desc: "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.\n\n**Instantiating an Synchronous Queue Client**\n\n```java\nQueueClient client = new QueueClientBuilder()\n .connectionString(\"connectionstring\")\n .endpoint(\"endpoint\")\n .buildClient();\n```\n\nView <xref uid=\"com.azure.storage.queue.QueueClientBuilder\" data-throw-if-not-resolved=\"false\" data-raw-source=\"this\"></xref> for additional ways to construct the client."
metadata: {}
package: "com.azure.storage.queue"
artifact: com.azure:azure-storage-queue:12.22.1