你能帮帮我吗我试图通过代码使用过滤器策略在. net中创建一个SNS订阅。我的主题具有以下订阅筛选器策略(使用MessageAttribute):
enter image description here
我尝试配置如下:
public async Task CreateSubscriptionAsync()
{
using var snsClient = new AmazonSimpleNotificationServiceClient(_amazonSimpleNotificationServiceConfig);
_ = await snsClient.SubscribeAsync(new SubscribeRequest
{
Protocol = "sqs",
Endpoint = _sqsSettings.Queues!.First(queue => !queue.Consume).Url,
TopicArn = _snsSettings.Topic!.Arn,
Attributes = new Dictionary<string, string>() { { "MessageType", "OrderReceived" } }
});
}
但我收到以下错误:
Amazon.SimpleNotificationService.Model.InvalidParameterException:AttributeName。
你能帮帮我吗?
1条答案
按热度按时间4szc88ey1#
做的人,按照答案: