Udostępnij za pośrednictwem


QueueClient.SendMessageAsync Method

Definition

Overloads

SendMessageAsync(String)

Adds a new message to the back of a queue.

A message must be in a format that can be included in an XML request with UTF-8 encoding. Otherwise MessageEncoding option can be set to Base64 to handle non compliant messages. The encoded message can be up to 64 KiB in size for versions 2011-08-18 and newer, or 8 KiB in size for previous versions.

For more information, see Put Message.

SendMessageAsync(String, CancellationToken)

Adds a new message to the back of a queue.

A message must be in a format that can be included in an XML request with UTF-8 encoding. Otherwise MessageEncoding option can be set to Base64 to handle non compliant messages. The encoded message can be up to 64 KiB in size for versions 2011-08-18 and newer, or 8 KiB in size for previous versions.

For more information, see Put Message.

SendMessageAsync(BinaryData, Nullable<TimeSpan>, Nullable<TimeSpan>, CancellationToken)

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.

A message must be in a format that can be included in an XML request with UTF-8 encoding. Otherwise MessageEncoding option can be set to Base64 to handle non compliant messages. The encoded message can be up to 64 KiB in size for versions 2011-08-18 and newer, or 8 KiB in size for previous versions.

For more information, see Put Message.

SendMessageAsync(String, Nullable<TimeSpan>, Nullable<TimeSpan>, CancellationToken)

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.

A message must be in a format that can be included in an XML request with UTF-8 encoding. Otherwise MessageEncoding option can be set to Base64 to handle non compliant messages. The encoded message can be up to 64 KiB in size for versions 2011-08-18 and newer, or 8 KiB in size for previous versions.

For more information, see Put Message.

SendMessageAsync(String)

Source:
QueueClient.cs
Source:
QueueClient.cs

Adds a new message to the back of a queue.

A message must be in a format that can be included in an XML request with UTF-8 encoding. Otherwise MessageEncoding option can be set to Base64 to handle non compliant messages. The encoded message can be up to 64 KiB in size for versions 2011-08-18 and newer, or 8 KiB in size for previous versions.

For more information, see Put Message.

public virtual System.Threading.Tasks.Task<Azure.Response<Azure.Storage.Queues.Models.SendReceipt>> SendMessageAsync (string messageText);
abstract member SendMessageAsync : string -> System.Threading.Tasks.Task<Azure.Response<Azure.Storage.Queues.Models.SendReceipt>>
override this.SendMessageAsync : string -> System.Threading.Tasks.Task<Azure.Response<Azure.Storage.Queues.Models.SendReceipt>>
Public Overridable Function SendMessageAsync (messageText As String) As Task(Of Response(Of SendReceipt))

Parameters

messageText
String

Message text.

Returns

Response<T>

Remarks

This version of library does not encode message by default. Base64 was the default behavior in the prior v11 library. See CloudQueue.EncodeMessage.

Applies to

SendMessageAsync(String, CancellationToken)

Source:
QueueClient.cs
Source:
QueueClient.cs

Adds a new message to the back of a queue.

A message must be in a format that can be included in an XML request with UTF-8 encoding. Otherwise MessageEncoding option can be set to Base64 to handle non compliant messages. The encoded message can be up to 64 KiB in size for versions 2011-08-18 and newer, or 8 KiB in size for previous versions.

For more information, see Put Message.

public virtual System.Threading.Tasks.Task<Azure.Response<Azure.Storage.Queues.Models.SendReceipt>> SendMessageAsync (string messageText, System.Threading.CancellationToken cancellationToken = default);
abstract member SendMessageAsync : string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.Storage.Queues.Models.SendReceipt>>
override this.SendMessageAsync : string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.Storage.Queues.Models.SendReceipt>>
Public Overridable Function SendMessageAsync (messageText As String, Optional cancellationToken As CancellationToken = Nothing) As Task(Of Response(Of SendReceipt))

Parameters

messageText
String

Message text.

cancellationToken
CancellationToken

Optional CancellationToken.

Returns

Response<T>

Remarks

This version of library does not encode message by default. Base64 was the default behavior in the prior v11 library. See CloudQueue.EncodeMessage.

Applies to

SendMessageAsync(BinaryData, Nullable<TimeSpan>, Nullable<TimeSpan>, CancellationToken)

Source:
QueueClient.cs
Source:
QueueClient.cs

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.

A message must be in a format that can be included in an XML request with UTF-8 encoding. Otherwise MessageEncoding option can be set to Base64 to handle non compliant messages. The encoded message can be up to 64 KiB in size for versions 2011-08-18 and newer, or 8 KiB in size for previous versions.

For more information, see Put Message.

public virtual System.Threading.Tasks.Task<Azure.Response<Azure.Storage.Queues.Models.SendReceipt>> SendMessageAsync (BinaryData message, TimeSpan? visibilityTimeout = default, TimeSpan? timeToLive = default, System.Threading.CancellationToken cancellationToken = default);
abstract member SendMessageAsync : BinaryData * Nullable<TimeSpan> * Nullable<TimeSpan> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.Storage.Queues.Models.SendReceipt>>
override this.SendMessageAsync : BinaryData * Nullable<TimeSpan> * Nullable<TimeSpan> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.Storage.Queues.Models.SendReceipt>>
Public Overridable Function SendMessageAsync (message As BinaryData, Optional visibilityTimeout As Nullable(Of TimeSpan) = Nothing, Optional timeToLive As Nullable(Of TimeSpan) = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of Response(Of SendReceipt))

Parameters

message
BinaryData

Message.

visibilityTimeout
Nullable<TimeSpan>

Visibility timeout. Optional with a default value of 0. Cannot be larger than 7 days.

timeToLive
Nullable<TimeSpan>

Optional. Specifies the time-to-live interval for the message

cancellationToken
CancellationToken

Optional CancellationToken.

Returns

Response<T>

Remarks

This version of library does not encode message by default. Base64 was the default behavior in the prior v11 library. See CloudQueue.EncodeMessage.

Applies to

SendMessageAsync(String, Nullable<TimeSpan>, Nullable<TimeSpan>, CancellationToken)

Source:
QueueClient.cs
Source:
QueueClient.cs

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.

A message must be in a format that can be included in an XML request with UTF-8 encoding. Otherwise MessageEncoding option can be set to Base64 to handle non compliant messages. The encoded message can be up to 64 KiB in size for versions 2011-08-18 and newer, or 8 KiB in size for previous versions.

For more information, see Put Message.

public virtual System.Threading.Tasks.Task<Azure.Response<Azure.Storage.Queues.Models.SendReceipt>> SendMessageAsync (string messageText, TimeSpan? visibilityTimeout = default, TimeSpan? timeToLive = default, System.Threading.CancellationToken cancellationToken = default);
abstract member SendMessageAsync : string * Nullable<TimeSpan> * Nullable<TimeSpan> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.Storage.Queues.Models.SendReceipt>>
override this.SendMessageAsync : string * Nullable<TimeSpan> * Nullable<TimeSpan> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.Storage.Queues.Models.SendReceipt>>
Public Overridable Function SendMessageAsync (messageText As String, Optional visibilityTimeout As Nullable(Of TimeSpan) = Nothing, Optional timeToLive As Nullable(Of TimeSpan) = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of Response(Of SendReceipt))

Parameters

messageText
String

Message text.

visibilityTimeout
Nullable<TimeSpan>

Visibility timeout. Optional with a default value of 0. Cannot be larger than 7 days.

timeToLive
Nullable<TimeSpan>

Optional. Specifies the time-to-live interval for the message

cancellationToken
CancellationToken

Optional CancellationToken.

Returns

Response<T>

Remarks

This version of library does not encode message by default. Base64 was the default behavior in the prior v11 library. See CloudQueue.EncodeMessage.

Applies to