Issues

ZF-10610: Zend_Service_Amazon_Sqs is not using the region to create queues

Description

Create queue is not using the region to correctly create the queue on the specified Amazon Endpoint. Amazon has four endpoints that can be used based on your location http://docs.amazonwebservices.com/AWSSimpleQueueSe… Create is not using the region parameter to create queues on the correct endpoint.

In Zend_Service_Amazon_Sqs the _makeRequest method should take into account the region that was specified in the constructor.

$client->setUri('http://'.$this->_sqsEndpoint);

Comments

I worked around this by extending the class with this method and putting it to use in the constructor.

protected function _setEndpoint($endpoint) { $this->_sqsEndpoint = $endpoint; }

public function __construct($accessKey = null, $secretKey = null, $region = null) { parent::__construct($accessKey, $secretKey, $region); $endpoint = "sqs.$region.amazonaws.com"; $this->_setEndpoint($endpoint); }

Sorry for that terrible formatting. Let me try that again.


protected function _setEndpoint($endpoint) 
{
    $this->_sqsEndpoint = $endpoint;
}
    
public function __construct($accessKey = null, $secretKey = null, $region = null)
{
    parent::__construct($accessKey, $secretKey, $region);
    $endpoint = "sqs.$region.amazonaws.com";
    $this->_setEndpoint($endpoint);
}

Added the code to override the default region.

Added a list of possible endpoints (as of 2011-09-25) and a method to add new regions if they appear..

Fixed in trunk (commit #24469).

Fixed in branches/release-1.11 (commit #24470)