diff --git a/.changes/nextrelease/remove-sqs-middleware.json b/.changes/nextrelease/remove-sqs-middleware.json new file mode 100644 index 0000000000..21ac80de96 --- /dev/null +++ b/.changes/nextrelease/remove-sqs-middleware.json @@ -0,0 +1,7 @@ +[ + { + "type": "bugfix", + "category": "Sqs", + "description": "Moves queue url middleware, which is no longer needed after the SQS migration from query to json protocol." + } +] \ No newline at end of file diff --git a/src/Sqs/SqsClient.php b/src/Sqs/SqsClient.php index fcc7ce31ee..4492cc7427 100644 --- a/src/Sqs/SqsClient.php +++ b/src/Sqs/SqsClient.php @@ -64,7 +64,6 @@ public function __construct(array $config) { parent::__construct($config); $list = $this->getHandlerList(); - $list->appendBuild($this->queueUrl(), 'sqs.queue_url'); $list->appendSign($this->validateMd5(), 'sqs.md5'); } @@ -93,29 +92,6 @@ public function getQueueArn($queueUrl) return $queueArn; } - /** - * Moves the URI of the queue to the URI in the input parameter. - * - * @return callable - */ - private function queueUrl() - { - return static function (callable $handler) { - return function ( - CommandInterface $c, - RequestInterface $r = null - ) use ($handler) { - if ($c->hasParam('QueueUrl')) { - $r = $r->withUri(UriResolver::resolve( - $r->getUri(), - new Uri($c['QueueUrl']) - )); - } - return $handler($c, $r); - }; - }; - } - /** * Calculates the expected md5 hash of message attributes according to the encoding * scheme detailed in SQS documentation. diff --git a/tests/Sqs/SqsClientTest.php b/tests/Sqs/SqsClientTest.php index 0b9e7f0d0d..488667c0a7 100644 --- a/tests/Sqs/SqsClientTest.php +++ b/tests/Sqs/SqsClientTest.php @@ -165,19 +165,4 @@ public function testSkipsCommandsThatAreNotReceiveMessage() $this->addMockResults($client, [new Result()]); $client->listQueues(); } - - public function testUpdatesQueueUrl() - { - // Setup state of command/request - $newUrl = 'https://queue.amazonaws.com/stuff/in/the/path'; - $client = new SqsClient([ - 'region' => 'us-east-1', - 'version' => 'latest' - ]); - $this->addMockResults($client, [[]]); - $client->getHandlerList()->appendSign(Middleware::tap(function ($c, $r) use ($newUrl) { - $this->assertSame($newUrl, (string)$r->getUri()); - })); - $client->receiveMessage(['QueueUrl' => $newUrl]); - } }