[英]Errors when Sending a Message to a Queue on SQS AWS
Getting Errors获取错误
when trying to Sending a Message to a Queue on SQS AWS, and data returns Null.当尝试向 SQS AWS 上的队列发送消息时,数据返回 Null。 what am I doing wrong?
我究竟做错了什么? message contains correct data.
消息包含正确的数据。
/**
*
* @param message
*/
function sendMessage (message) {
// Send the message to this other Queue
sqs.sendMessage(message, function (err, data) {
if (err) {
console.log('Error', err)
} else {
console.log('Success', data.MessageId)
}
}
)
}
It is not clear what is the message
in your code, However, here the message
should be params of the sendMessage
function and not the message data itself.目前尚不清楚您的代码中的
message
是什么,但是,这里的message
应该是sendMessage
function 的参数,而不是消息数据本身。 Then, it should be like (minimal options):然后,它应该像(最小选项):
message = {
MessageBody: JSON.stringify(real_message_content),
QueueUrl: process.env.SQS_MAILER, <= your queue
};
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.