- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我看到的都是这种类型的数据:
{
MessageId: 'c604c772-8468-4cd2-8f3e-9b430ed52d92',
ReceiptHandle: 'AQEBHyPYuNqFztvy9QNOHeLQg==',
MD5OfBody: '096c6509c8628bde267adde2b105f4e4',
Body: 'foobar'
}
当我进行此调用以从队列中读取时:
const conf = {
QueueUrl: 'https://sqs.us-west-2.amazonaws.com/920371/logging-q',
WaitTimeSeconds: 19, // max is 20 (off by one errors avoided!)
MaxNumberOfMessages: 9 // max is 10 (off by one errors avoided!)
};
sqs.receiveMessage(conf, cb);
但我在将消息放入队列时添加了 MessageAttributes:
sqs.sendMessageBatch({QueueUrl,Entries: v}, cb);
条目是一个数组:
{
Id: uuid.v4(),
MessageBody: 'foobar',
MessageAttributes: {
logStream: {
StringValue: LOG_STREAM,
DataType: 'String'
},
logGroup: {
StringValue: LOG_GROUP,
DataType: 'String'
}
}
}
有人知道为什么当我从队列中读取时 MessageAttributes 没有出现,即使它们可能被插入队列?
最佳答案
在您的 receiveMessage
conf 中,您需要包含 MessageAttributeNames
并为其提供属性名称列表或 All
。看起来您正在使用 javascript,因此您需要查看 receiveMessage
的 Javascript SDK 文档 https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/SQS.html#receiveMessage-property
关于amazon-web-services - SQS 消息接收器中缺少 MessageAttributes 属性,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57173184/
我编写了以下 API 来接收消息: app.get('/receive', function(req, res) { var params = { QueueUrl: queu
我看到的都是这种类型的数据: { MessageId: 'c604c772-8468-4cd2-8f3e-9b430ed52d92', ReceiptHandle: '
我看到的都是这种类型的数据: { MessageId: 'c604c772-8468-4cd2-8f3e-9b430ed52d92', ReceiptHandle: '
我已将 SNS 端点连接到 iOS 应用程序。当我发布到 sns 端点时: anSNS.publish( TargetArn=u
我正在设置一个 SQS 队列,以摄取要由后端容器处理的配置数据 block 。我的第一个想法是 json.dumps 带有配置信息的字典,并通过 sqsclient.send_message() 的
我在 CloudFormation 文档中尝试了使用 MessageAttributes 的多种变体,但无法使其工作。这就是我所得到的: HttpApiSqsIntegration: Type:
我正在尝试使用 boto3 库写入 SQS 消息属性。 import boto3 sqs = boto3.client('sqs') response = sqs.send_message(
我一直在尝试了解如何克服该错误: Property validation failure: [Value of property {/RequestParameters/MessageAttribut
我是一名优秀的程序员,十分优秀!