ElcasticMQ + AWS PHP SDK
Я использую aws-php-sdk версии 3.96 и asticMQ. У меня есть бродячая коробка, в которой работает мой разработчик. Я установил asticMQ и запустил его вне vagrant с помощью обычной команды:
java -Dconfig.file=custom.conf -jar elasticmq-server-0.14.7.jar
Вот как выглядит мой файл custon.conf:
include classpath("application.conf")
node-address {
protocol = http
host = localhost
port = 9324
context-path = ""
}
rest-sqs {
enabled = true
bind-port = 9324
bind-hostname = "0.0.0.0"
// Possible values: relaxed, strict
sqs-limits = strict
}
generate-node-address = false
queues {
export_participant_usage_normal {}
}
Я использую библиотеку enqueue interop для реализации SQS, и вот как я пытаюсь попасть в очередь:
$factory = new \Enqueue\Sqs\SqsConnectionFactory([
'key' => 'x ',
'secret' => 'y',
'endpoint' => 'http://localhost:9324',
'region' => 'us-east-1',
'version' => 'latest',
]);
$context = $factory->createContext();
$queue = $context->createQueue($task . '_' . $priority);
$message = $context->createMessage($payload);
$context->createProducer()->send($queue, $message);
Я получаю следующую ошибку при попытке отправить сообщение:
Error executing "GetQueueUrl" on "http://localhost:9324"; AWS HTTP error: cURL error 7: Failed connect to localhost:9324; Connection refused (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)
Не знаю почему, но не могу подключиться к localhost:9324. В браузере попадание в эту конечную точку "работает" в том смысле, что она соединяется, но показывает обычную ошибку пропуска действия.
ElasticMQ: https://github.com/softwaremill/elasticmq Enqueue / SQS: https://php-enqueue.github.io/transport/sqs/
Спасибо