ZF-12368: Zend_Cloud_QueueService_Adapter_Sqs wrong use of const CREATE_TIMEOUT, cannot set visibility timeout when creating new queues

Issue Type: Bug Created: 2012-08-13T14:07:45.000+0000 Last Updated: 2012-08-13T14:45:00.000+0000 Status: Open Fix version(s): Reporter: Emmanuel BOTROS (mebyz) Assignee: Matthew Weier O'Phinney (matthew) Tags: - Zend_Cloud_QueueService

Related issues: Attachments:


in v1.11.7, in Class "Zend_Cloud_QueueService_Adapter_Sqs" (Zend/Cloud/QueueService/Adapter/Sqs.php)

look at this part of the code in the function "createQueue":
public function createQueue($name, $options = null) { try { return $this->_sqs->create($name, $options[self::CREATE_TIMEOUT]); } catch(Zend_Service_Amazon_Exception $e) { throw new Zend_Cloud_QueueService_Exception('Error on queue creation: '.$e->getMessage(), $e->getCode(), $e); } }

here is how the CREATE_TIMEOUT is defined on top of this file : const CREATE_TIMEOUT = 30;

my issue is the wrong use of const self::CREATE_TIMEOUT in the createQueue function : the const first defines a "VALUE" for the visibility timer but is then used as an "ID" in the options Array passed to the create function

so if im not wrong (i tested this case successfully) this means the only way to specify a timeout of 10 seconds at queue creation is : $mySQSAdapter->createQueue("myQueue",Array(30=>10));

which isn't very logic.

=> a better way would be to define the const as so : const CREATE_TIMEOUT = 'visibility_timeout'; and then you could create a queue as so : $mySQSAdapter->createQueue("myQueue",Array('visibility_timeout'=>30));

it finally would be really nice to update the doc shown here accordingly :…

This is my first ZF Issue post, please feel free to comment if im wrong or if i miss something here.

Thanks in advance Emmanuel BOTROS


No comments to display

Have you found an issue?

See the Overview section for more details.


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

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