问题描述
我有 SNS FIFO 主题,并使用步骤函数 SnsPublish 发布消息,但出现此错误
Error
SNS.InvalidParameterException
Cause
Invalid parameter: The MessageGroupId parameter is required for FIFO topics (Service: AmazonSNS; Status Code: 400; Error Code: InvalidParameter; Request ID: 2dcc9124-1a2d-5527-93f1-c8a4f27ac92a; Proxy: null)
你能帮助我如何在 CDK 中绑定 MessageGroupId 吗? 当我添加属性 messageGroupId CDK 显示类型为“{ topic: sns.Topic;”的参数消息:sfn.TaskInput; messageGroupId:字符串; }' 不可分配给类型为 'SnsPublishProps' 的参数。 我花了两天的时间,直到现在我都没有找到任何解决方案
const newBookinewBookingRequestTopicngsQueue = new sqs.Queue(this,'newBookingsQueueTestYAHYA',{
queueName: 'newBookingsQueueTest.fifo',contentBasedDeduplication: true,fifo: true
});
const sendNewBookingRequestSNSNotification = new tasks.SnsPublish(
this,'Publish alert notification',{
integrationPattern: sfn.IntegrationPattern.WAIT_FOR_TASK_TOKEN,topic: newBookinewBookingRequestTopicngsQueue,message:sfn.TaskInput.fromObject({
snsMessage: sfn.JsonPath.entirePayload,taskToken:sfn.JsonPath.taskToken
}),/* MessageGroupId : "messageGroupId1",MessageDeduplicationId: "messageDeduplicationId1" */
}
);
***'MessageGroupI' 不存在于类型 'SnsPublishProps'
'MessageDeduplicationId' 不存在于类型 'SnsPublishProps'***
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)