I’m trying to run a test for a project using AWS SNS but I’m a little lost using filters:
foreach (var hobby in attributes)
{
publishRequest.MessageAttributes.Add("Hobbies", new MessageAttributeValue
{
DataType = "String",
StringValue = hobby
});
}
// Publish the message to the topic
await _snsClient.PublishAsync(publishRequest);
Using this JSON as my request:
{
“Body”: “Hello subscribers!”,
“Subject”: “New Content for users Available “,
“Attributes”:[“Games”,”Coffee”]
}
I get the following exception: “System.ArgumentException: An item with the same key has already been added. Key: Hobbies”
My subscriptors filter policy look like this: “Hobbies”: [
“Travel”,
“Home”,
“Coffee”
]
How could I send the email for the subscribers that have the Attributes the request send me?
Artic Soci is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.