我需要有关如何使用CPAN模块
将MessageGroupId作为参数传递的帮助我尝试了以下内容:
my $messageGroupId = 1;
my $q = $sqs->GetQueue('http://queue.amazonaws.com/' . $queue_name);
$q->{MessageGroupId} = $messageGroupId;
$q->SendMessage($message);
我也尝试将MessageGroupId放在$ message变量中:
my $messageGroupId = 1;
my $q = $sqs->GetQueue('http://queue.amazonaws.com/' . $queue_name);
$q->{MessageGroupId} = $messageGroupId;
$q->SendMessage({ MessageGroupId => 1 });
但是SQS总是给出这个错误:
ERROR [try ]: On calling SendMessage: 400 Bad Request (The request must contain the parameter MessageGroupId.)
答案 0 :(得分:0)
你几乎拥有它。它看起来像是在期待:
$q->SendMessage($message, { MessageGroupId => 1 });
答案 1 :(得分:0)
答案 2 :(得分:0)
The answer by @ysth was almost correct; I found the below to work:
$q->SendMessage($message, ("MessageGroupId" => 1));