
Alibaba Cloud RealtimeTrigger
CertifiedTrigger a flow for each MNS queue message
Alibaba Cloud RealtimeTrigger
Trigger a flow for each MNS queue message
Long-polls an MNS queue and starts one execution per message, with the message body available as trigger.data. It only polls when executions are requested, and deletes the messages of a poll once Kestra has taken them and requests more, so a stop or kill never deletes a message that was not handed over. Use Trigger to process messages in batches.
type: io.kestra.plugin.alibaba.mns.RealtimeTriggerExamples
Log each order as it arrives
id: mns_realtime
namespace: company.team
triggers:
- id: on_message
type: io.kestra.plugin.alibaba.mns.RealtimeTrigger
accessKeyId: "{{ secret('ALIBABA_ACCESS_KEY_ID') }}"
accessKeySecret: "{{ secret('ALIBABA_ACCESS_KEY_SECRET') }}"
region: cn-hangzhou
accountId: "{{ secret('ALIBABA_ACCOUNT_ID') }}"
queue: orders
serdeType: JSON
tasks:
- id: log
type: io.kestra.plugin.core.log.Log
message: "Order {{ trigger.data.orderId }}"
Properties
accessKeyId *string
AccessKey ID
The AccessKey ID used to authenticate against Alibaba Cloud.
accessKeySecret *string
AccessKey secret
The AccessKey secret paired with the AccessKey ID.
queue *string
Queue
The name of the MNS queue.
accountId string
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.
allowConcurrent boolean
falseSpecifies whether a trigger is allowed to start a new execution even if a previous run is still in progress.
autoDelete booleanstring
trueAuto-delete
Delete messages from the queue once they are handed to Kestra: Trigger deletes them once the ION file is stored, RealtimeTrigger once Kestra has taken them and requests more messages. When false, they become visible again after the queue's visibility timeout.
batchSize integerstring
16Batch size
Maximum number of messages fetched per request, from 1 to 16, 16 by default. Each message still starts its own execution.
endpointOverride string
Endpoint override
Custom http or https endpoint URL. When set, it takes precedence over the endpoint derived from region.
region string
Region
The Alibaba Cloud region ID, for example cn-hangzhou. The service endpoint is derived from it unless endpointOverride is set.
securityToken string
Security token
Optional Security Token Service (STS) token, required when using temporary credentials.
serdeType string
STRINGSTRINGJSONSerde type
STRING keeps message bodies as text, JSON parses them. A body that is not valid JSON is kept as a string and logged.
stopAfter array
CREATEDSUBMITTEDRUNNINGPAUSEDRESTARTEDKILLINGSUCCESSWARNINGFAILEDKILLEDCANCELLEDQUEUEDRETRYINGRETRIEDSKIPPEDBREAKPOINTRESUBMITTEDList of execution states after which a trigger should be stopped (a.k.a. disabled).
waitTime string
PT20SWait time
How long each long-poll request waits for messages, from 1 to 30 seconds, 20 seconds by default.
when string
trueA condition that determines whether the trigger should run.
A Pebble expression evaluated at trigger time. The trigger fires only when the expression evaluates to a truthy value (true, a non-empty string, a non-zero number). Use this to gate trigger execution on dynamic runtime values such as execution labels, flow variables, or environment conditions.
Outputs
data object
The message body
Text with serdeType: STRING, or the parsed value with serdeType: JSON (kept as text when it is not valid JSON).
messageId string
MNS message ID