Reputation: 193
Function to publish message
this.sns = new SNS({ apiVersion: '2010-03-31', region: <region> });
async publishMessage() {
try {
const params = {
MessageGroupId: 'test',
MessageDeduplicationId: uuidv4(),
Message: 'test',
TopicArn: 'arn:aws:sns:<region>:<accountID>:item-dev-topic.fifo',
};
const res = await this.sns.listTopics().promise();
// Works : this returns the topic which I plan to use
const response = await this.sns.publish(params).promise();
// Fails : this line gives error saying multiple invalid param (MessageGroupId, MessageDeduplicationId)
console.log(response);
return res;
}
catch (error) {
throw new Error(error);
}
}
Error : saying multiple invalid param (MessageGroupId, MessageDeduplicationId) When I remove this param it says those params are missing, and when I add these params it says invalid param.
Observations :
Upvotes: 1
Views: 2064
Reputation: 193
Upgrading the AWS SDK to latest version fixed this breaking issue
SDK version which had the error : v2.744.0
Upgrading to v2.784.0 fixed the above issue
Upvotes: 2