Open jasonbigl opened 1 week ago
Hi @jasonbigl, sorry to hear about your issues. Previously we had a middleware, which you can check here, that used to pick up the QueueUrl, from the command or request parameters, and made it the request URL to be used, however, due to a protocol migration from query to json that the service did, that is not possible anymore. However, you may have a workaround and is passing the endpoint to the client constructor instead, as follow:
<?php
require '../vendor/autoload.php';
use Aws\Sqs\SqsClient;
$client = new SqsClient([
'region' => getenv('TEST_REGION'),
'endpoint' => 'YOUR_CUSTOM_ENDPOINT' // in this case I guess it would be "http://elasticmq:9324"
]);
$response = $client->sendMessage([
'QueueUrl' => 'YOUR_QUEUE_URL',
'MessageBody' => 'Test message body'
]);
print_r([$response]);
You can also reference the following previous issue.
Please let me know if that helps!
Thanks!
Describe the bug
I'm using docker image
softwaremill/elasticmq
to simulate local SQS endpoint, it help me test code in my local machine, I use php sdk to send message to it (http://localhost:9324/000000000000/emails), in version 3.238.3, it works well, however if I upgrade the sdk to latest version (3.314.3), I always get the error saying thatPOST https://sqs.us-east-1.amazonaws.com
resulted in a404 Not Found
response, it seems the new sdk always to send to online sqs endpoint, ignore the queue url I specified.Expected Behavior
php sdk should always send message to the exact endpoint that I specified in the QueueUrl parameter
Current Behavior
php sdk send message to the online endpoint
Reproduction Steps
softwaremill/elasticmq
and run itPossible Solution
No response
Additional Information/Context
No response
SDK version used
3.314.3
Environment details (Version of PHP (
php -v
)? OS name and version, etc.)php 8.3, debian 12