现在我已经尝试根据消息属性名称=“类”过滤消息。正如你在下面的代码中看到的
//Specify attribute list
List<string> AttributesList = new List<string>();
AttributesList.Add("Class");
receiveMessageRequest.MessageAttributeNames = AttributesList;
receiveMessageRequest.QueueUrl = urlSQS;
receiveMessageRequest.MaxNumberOfMessages = 10;
ReceiveMessageResponse receiveMessageResponse = objClient.ReceiveMessage(receiveMessageRequest);
Run Code Online (Sandbox Code Playgroud)
但消息并未根据提供的 MessageAttributeName = "class" 进行过滤。