Issues

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

Issue Type: Bug Created: 2010-10-28T13:18:21.000+0000 Last Updated: 2011-09-26T16:27:59.000+0000 Status: Resolved Fix version(s): - 1.11.11 (29/Sep/11)

Reporter: Nitin Ahuja (nitinahuja) Assignee: Enrico Zimuel (zimuel) Tags: - Zend_Service_Amazon

Related issues: Attachments: - Sqs.patch

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

Posted by Jesper Forsberg (uppe) on 2011-08-30T21:26:24.000+0000

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); }

Posted by Jesper Forsberg (uppe) on 2011-08-30T21:28:33.000+0000

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

<pre class="highlight">
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);
}

Posted by Christoph Kempen (webpatser) on 2011-09-25T08:37:05.000+0000

Added the code to override the default region.

Posted by Christoph Kempen (webpatser) on 2011-09-25T10:26:35.000+0000

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

Posted by Enrico Zimuel (zimuel) on 2011-09-26T16:23:56.000+0000

Fixed in trunk (commit #24469).

Posted by Enrico Zimuel (zimuel) on 2011-09-26T16:27:59.000+0000

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

Have you found an issue?

See the Overview section for more details.

Copyright

© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.

Contacts