Alibaba Cloud Consume

Alibaba Cloud Consume

Certified

Consume messages from an MNS queue

Receives messages until the queue is empty, maxRecords is reached or maxDuration (20 seconds by default) elapses, stores them in an ION file in internal storage and then, by default, deletes them from the queue. Delivery is at least once: messages are only deleted after the file is stored.

yaml
type: io.kestra.plugin.alibaba.mns.Consume

Consume up to 100 JSON messages

yaml
id: mns_consume
namespace: company.team

tasks:
  - id: consume
    type: io.kestra.plugin.alibaba.mns.Consume
    accessKeyId: "{{ secret('ALIBABA_ACCESS_KEY_ID') }}"
    accessKeySecret: "{{ secret('ALIBABA_ACCESS_KEY_SECRET') }}"
    region: cn-hangzhou
    accountId: "{{ secret('ALIBABA_ACCOUNT_ID') }}"
    queue: orders
    serdeType: JSON
    maxRecords: 100
    maxDuration: PT20S
Properties

AccessKey ID

The AccessKey ID used to authenticate against Alibaba Cloud.

AccessKey secret

The AccessKey secret paired with the AccessKey ID.

Queue

The name of the MNS queue.

Account ID

The Alibaba Cloud account ID, used to derive the default endpoint https://<accountId>.mns.<region>.aliyuncs.com. Not needed when endpointOverride is set.

Assets this task consumes as inputs or produces as outputs, for lineage tracking and the asset graph (Enterprise Edition). A flow declaring this property on a task is rejected in the open-source edition.

Definitions
assetFailureBehaviorstring
Possible Values
IGNOREFAILWARN

Asset failure behavior

Behavior applied to the task state when a declared asset fails to render, emit, or be persisted (e.g. a lock conflict): FAIL escalates it to FAILED, WARN (default) warns it if it would otherwise succeed, IGNORE leaves the state untouched.

enableAutobooleanstring

Whether to auto-register assets referenced dynamically at runtime that are not statically declared in inputs or outputs.

inputsarray

The assets consumed as inputs.

id*string
Min length1
typestring
outputs

The assets produced as outputs.

id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*string
Min length1

Custom asset type

descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
Defaulttrue

Auto-delete

Delete messages from the queue once the ION file is stored. When false, they become visible again after the queue's visibility timeout.

Endpoint override

Custom http or https endpoint URL. When set, it takes precedence over the endpoint derived from region.

DefaultPT20S

Max duration

Stop after this duration elapses, 20 seconds by default. Keep it below the queue's visibility timeout (30 seconds by default): messages are deleted at the end of the run, and a message whose receipt handle expired in the meantime is delivered again.

Default1000

Max records

Stop after consuming this many messages, at least 1, 1000 by default.

Region

The Alibaba Cloud region ID, for example cn-hangzhou. The service endpoint is derived from it unless endpointOverride is set.

Security token

Optional Security Token Service (STS) token, required when using temporary credentials.

DefaultSTRING
Possible Values
STRINGJSON

Serde type

STRING keeps message bodies as text, JSON parses them. A body that is not valid JSON is kept as a string and logged.

Number of messages consumed

Formaturi

URI of the ION file holding the messages in internal storage, unset when no message was received

Unitmessages

Number of messages consumed from the MNS queue.