【发布时间】:2021-08-24 10:03:42
【问题描述】:
我的情况是我有 2 个任务处于并行状态。我们使用 SNS,需要“MessageAttributes”字段通过 DL 队列重新处理消息。
我发送给步进函数的输入是:
{
"Body": { "Message": "This is the body" },
"MessageAttribtutes": "These are the message attributes"
}
并行状态中的任务有一个“InputPath: $.Body”,所以任务的输入是
{
"Message": "This is the body"
}
它们还有一个“ResultPath: null”,因此它们返回原始输入。
但是并行状态的输出是
{
"Message": "This is the body"
},
{
"Message": "This is the body"
}
有没有办法让状态的输出变成这样?
{
"Body": { "Message": "This is the body" },
"MessageAttribtutes": "These are the message attributes"
},
{
"Body": { "Message": "This is the body" },
"MessageAttribtutes": "These are the message attributes"
}
这是我的 Step Function 定义:
{
"StartAt": "Process Videos",
"States": {
"Process Videos": {
"Type": "Parallel",
"Next": "Finalizer",
"InputPath": "$.Body",
"Branches": [
{
"StartAt": "GPS Parser",
"States": {
"GPS Parser": {
"Type": "Task",
"Resource": "x",
"ResultPath": null,
"End": true
}
}
},
{
"StartAt": "Video Creator",
"States": {
"Video Creator": {
"Type": "Task",
"Resource": "x",
"ResultPath": null,
"End": true
}
}
}
]
},
"Finalizer": {
"Type": "Task",
"Resource": "x",
"End": true
},
"ErrorHandler": {
"Type": "Task",
"Resource": "x",
"End": true
}
}
}
【问题讨论】: