ALIYUN::MNS::Queue は、キューを作成して、メッセージを保存する場合に使用します。 キューは、標準キューと遅延キューに分類されます。

メッセージの送信時に DelaySeconds パラメーターが指定されていないと、標準キューに送信されたメッセージはすぐに消費されます。 ただし、遅延キューに送信されたメッセージは、事前設定された遅延時間が経過した後でなければ消費されません。

構文

  1. { Type”: ALIYUN::MNS::Queue”, Properties”: { PollingWaitSeconds”: Integer, LoggingEnabled”: Boolean, MessageRetentionPeriod”: Integer, MaximumMessageSize”: Integer, DelaySeconds”: Integer, VisibilityTimeout”: Integer, GroupName : String }}

プロパティ

名前 データ型 必須/省略可能 更新可/不可 説明 制約
QueueName String 必須 不可 キューの名前。

名前は、リージョンの Alibaba Cloud アカウント内で一意でなければなりません。 名前は最大 256 文字で、文字、数字、およびハイフン (-) を含めることができます。 先頭は文字か数字でなければなりません。

DelaySeconds Integer 省略可能 キューに送信されたメッセージが消費されるまでの遅延時間。 単位 :秒。 パラメーター値は、0 から 604800 (7 日) の範囲の整数でなければなりません。 デフォルト値:0。
MaximumMessageSize Integer 省略可能 キューに送信されるメッセージの最大本文長。 単位:バイト。 パラメーター値は、1024 (1 KB) から 65536 (64 KB) の範囲の整数でなければなりません。 デフォルト値:65536 (64 KB)
MessageRetentionPeriod Integer 省略可能 不可 キュー内のメッセージの最大存続期間。 このパラメーターで指定された時間が経過すると、消費されたかどうかにかかわらず、メッセージは削除されます。 単位:秒。 パラメーター値は、60 (1 分) から 604800 (7 日) の範囲の整数でなければなりません。 デフォルト値:345600 (4 日)
VisibilityTimeout Integer 省略可能 メッセージがキューから消費された後、Inactive の状態でいる期間。 単位:秒。 パラメーター値は、1 から 43200 (12 時間) の範囲の整数でなければなりません。 デフォルト値:30。
PollingWaitSeconds Integer 省略可能 メッセージがキューに入るまで ReceiveMessage リクエストが待機できる最大時間。 単位:秒。

パラメーター値は、0 から 30 の範囲の整数でなければなりません。 デフォルト値:0。

LoggingEnabled Boolean 省略可能 ログ管理を有効にするかどうかを示します。 有効な値:True と False。 デフォルト値:False。

レスポンスパラメーター

Fn::GetAtt

QueueUrl:作成されたキューの URL。

  1. { ROSTemplateFormatVersion”: 2015-09-01”, Resources”: { Queue”: { Type”: ALIYUN::MNS::Queue”, Properties”: { PollingWaitSeconds”: { Ref”: PollingWaitSeconds }, LoggingEnabled”: { Ref”: LoggingEnabled }, MessageRetentionPeriod”: { Ref”: MessageRetentionPeriod }, MaximumMessageSize”: { Ref”: MaximumMessageSize }, DelaySeconds”: { Ref”: DelaySeconds }, VisibilityTimeout”: { Ref”: VisibilityTimeout }, QueueName”: { Ref”: QueueName } } } }, Parameters”: { PollingWaitSeconds”: { Default”: 0, Type”: Number”, Description”: It is the maximum time that a ReceiveMessage request could be waiting for any incoming messages, while there is no message in the queue. Measured in seconds.\nAn integer between 0 and 30 seconds. The default value is 0 (seconds)”, MaxValue”: 30, MinValue”: 0 }, LoggingEnabled”: { Default”: false, Type”: Boolean”, Description”: Whether to enable log management. \”true\” indicates that log management is enabled, whereas \”false\” indicates that log management is disabled. \nThe default value is false”, AllowedValues”: [ True”, true”, False”, false ] }, MessageRetentionPeriod”: { Default”: 345600, Type”: Number”, Description”: Maximum lifetime of the message in the queue, measured in seconds. After the time specified by this parameter expires, the message will be deleted regardless of whether it has been consumed.\nAn integer between 60 (1 minute) and 1296000 (15 days). The default value is 345600 (4 days)”, MaxValue”: 604800, MinValue”: 60 }, MaximumMessageSize”: { Default”: 65536, Type”: Number”, Description”: Maximum body length of a message sent to the queue, measured in bytes.\nAn integer between 1024 (1K) and 65536 (64K). The default value is 65536 (64K).”, MaxValue”: 65536, MinValue”: 1024 }, DelaySeconds”: { Default”: 0, Type”: Number”, Description”: It is measured in seconds. All messages sent to the queue can be consumed until the DelaySeconds expires.\nAn integer between 0 and 604800 (7 days). The default value is 0”, MaxValue”: 604800, MinValue”: 0 }, VisibilityTimeout”: { Default”: 30, Type”: Number”, Description”: Duration in which a message stays in Inactive status after it is consumed from the queue. Measured in seconds.\nAn integer between 1 and 43200 (12 hours). The default value is 30 (seconds)”, MaxValue”: 43200, MinValue”: 1 }, QueueName”: { MinLength”: 1, Type”: String”, Description”: Queue name”, MaxLength”: 256 } }, Outputs”: { QueueUrl”: { Description”: URL of created queue”, Value”: { Fn::GetAtt”: [ Queue”, QueueUrl ] } } }}
  1. </article>
  2. </main>