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.

C#
public virtual System.Threading.Tasks.Task<Azure.Response<Azure.Storage.Queues.Models.SendReceipt>> SendMessageAsync(string messageText);

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

Azure SDK for .NET Preview and Azure SDK for .NET Latest
Product Versions
Azure SDK for .NET Latest, Preview

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.

C#
public virtual System.Threading.Tasks.Task<Azure.Response<Azure.Storage.Queues.Models.SendReceipt>> SendMessageAsync(string messageText, System.Threading.CancellationToken cancellationToken = default);

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

Azure SDK for .NET Preview and Azure SDK for .NET Latest
Product Versions
Azure SDK for .NET Latest, Preview

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.

C#
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);

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

Azure SDK for .NET Preview and Azure SDK for .NET Latest
Product Versions
Azure SDK for .NET Latest, Preview

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.

C#
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);

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

Azure SDK for .NET Preview and Azure SDK for .NET Latest
Product Versions
Azure SDK for .NET Latest, Preview