你能帮帮我吗?我正在尝试使用 .net 中的过滤策略通过代码创建对 SNS 的订阅。我的主题具有以下订阅过滤策略(使用 MessageAttribute):
我尝试配置如下:
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.
你能帮帮我吗?