修改消息可见时间
@param string $queueName
@param $receiptHandle
@param int $visibilityTimeout
@return array
344186
public function changeMessageVisibility(string $queueName, $receiptHandle, int $visibilityTimeout){
        if(!$queueName || !$receiptHandle){
            return $this->error('参数有误');
        }
        try{
            $queue = $this->client->getQueueRef($queueName);
            $queue->changeMessageVisibility($receiptHandle, $visibilityTimeout);
            return $this->success('修改消息可见时间成功');
        }catch (MnsException $exception){
            return $this->parseException($exception, '修改消息可见时间');
        }
    }
842666
String recoverQueue(String queueName, QueueDeclaration queueDeclaration) throws Exception {
    try {
      String newQueueName =
          ((Queue.DeclareOk) queueDeclaration.invoke(getRecoveryChannel())).getQueue();
      if (queueName.equals(newQueueName))
        log.info("Recovered queue {} via {}", queueName, this);
      else {
        log.info("Recovered queue {} as {} via {}", queueName, newQueueName, this);
        queueDeclaration.name = newQueueName;
      }

      return newQueueName;
    } catch (Exception e) {
      log.error("Failed to recover queue {} via {}", queueName, this, e);
      if (throwOnRecoveryFailure() || Exceptions.isCausedByConnectionClosure(e))
        throw e;
      return queueName;
    }
  }
1163304
protected function _getOptionVisibilities($destCountry, $visibility)
    {
        /** @var Fontis_Australia_Helper_Australiapost $helper */
        $helper = Mage::helper('australia/australiapost');
        $suboptions = array();
        if ($helper->getPickUp() == $visibility && $destCountry != Fontis_Australia_Helper_Data::AUSTRALIA_COUNTRY_CODE) {
            $suboptions[] = 'pick up';
        }
        if ($helper->getExtraCover() == $visibility) {
            $suboptions[] = 'extra cover';
        }
        if ($helper->getSignatureOnDelivery() == $visibility && $destCountry == Fontis_Australia_Helper_Data::AUSTRALIA_COUNTRY_CODE) {
            $suboptions[] = 'signature on delivery';
        }
        return $suboptions;
    }
134356
public function getPageByVisibility( $visibility, $config = [] ) {

		$modelTable	= static::$modelTable;

		$config[ 'conditions' ][ "$modelTable.visibility" ]	= $visibility;

		return $this->getPage( $config );
	}
134064
@Override
    public java.util.concurrent.Future<ChangeMessageVisibilityResult> changeMessageVisibilityAsync(String queueUrl, String receiptHandle,
            Integer visibilityTimeout, com.amazonaws.handlers.AsyncHandler<ChangeMessageVisibilityRequest, ChangeMessageVisibilityResult> asyncHandler) {

        return changeMessageVisibilityAsync(
                new ChangeMessageVisibilityRequest().withQueueUrl(queueUrl).withReceiptHandle(receiptHandle).withVisibilityTimeout(visibilityTimeout),
                asyncHandler);
    }
115839
@Override
    public java.util.concurrent.Future<ChangeMessageVisibilityResult> changeMessageVisibilityAsync(String queueUrl, String receiptHandle,
            Integer visibilityTimeout) {

        return changeMessageVisibilityAsync(new ChangeMessageVisibilityRequest().withQueueUrl(queueUrl).withReceiptHandle(receiptHandle)
                .withVisibilityTimeout(visibilityTimeout));
    }
1069364
public ChangeMessageVisibilityResult changeMessageVisibility(String queueUrl,
	                                                             String receiptHandle,
	                                                             Integer visibilityTimeout) {
		ChangeMessageVisibilityRequest changeMessageVisibilityRequest =
				new ChangeMessageVisibilityRequest(queueUrl, receiptHandle, visibilityTimeout);
		return changeMessageVisibility(changeMessageVisibilityRequest);
	}
433376
protected function doOnce(string $queueName, Envelope $envelope) : array
    {
        $result = false;
        $message = $envelope->unwrap();

        $this->getLogger()->debug('Handling message {msg}', ['msg' => self::nameOf($message)]);
        try {
            $result = $this->handleMessage($message);
        } catch (Exception\MustStop $e) {
            $this->driver->ack($queueName, $envelope);
            throw $e;
        } catch (Exception\ShouldReleaseMessage $e) {
            $this->driver->release($queueName, $envelope);
            $this->getLogger()->debug('Releasing message {msg} due to {cls} exception: {err}', [
                'msg' => self::nameOf($message),
                'cls' => get_class($e),
                'err' => $e->getMessage(),
            ]);
            return [$result, true];
        } catch (\Exception $e) {
            // any other exception is simply logged. We and marked as failed
            // below. We only log here because we can't make guarantees about
            // the implementation of the handler and whether or not it actually
            // throws exceptions on failure (see PcntlForkingHandler).
            $this->getLogger()->critical('Unexpected {cls} exception handling {name} message: {msg}', [
                'cls'   => get_class($e),
                'name'  => self::nameOf($message),
                'msg'   => $e->getMessage()
            ]);
            $result = false;
        }
        $this->getLogger()->debug('Handled message {msg}', ['msg' => self::nameOf($message)]);

        if ($result) {
            $willRetry = false;
            $this->driver->ack($queueName, $envelope);
            $this->getLogger()->debug('Acknowledged message {msg}', ['msg' => self::nameOf($message)]);
        } else {
            $willRetry = $this->failed($queueName, $envelope);
            $this->getLogger()->debug('Failed message {msg}', ['msg' => self::nameOf($message)]);
        }

        return [$result, $willRetry];
    }
1149723
public function queue_purge($queue = '', $nowait = false, $ticket = null)
    {
        $ticket = $this->getTicket($ticket);
        list($class_id, $method_id, $args) = $this->protocolWriter->queuePurge($ticket, $queue, $nowait);

        $this->send_method_frame(array($class_id, $method_id), $args);

        if ($nowait) {
            return null;
        }

        return $this->wait(array(
            $this->waitHelper->get_wait('queue.purge_ok')
        ), false, $this->channel_rpc_timeout);
    }
989657
public function getFields($visibility = Field::VISIBILITY_PUBLIC)
    {
        $ret = [];
        foreach ($this->fields as $name => $field) {
            if ($field->getVisibility() & $visibility) {
                $ret[$name] = $field;
            }
        }
        return $ret;
    }
1270079
@Override
	public final void deleteTemporaryQueue(String queueName) throws JMSException
    {
        engine.deleteQueue(queueName);
        unregisterTemporaryQueue(queueName);
    }
286360
public function getQueues($retNum=1000, $prefix=null, $marker=null){
        $request = new ListQueueRequest($retNum, $prefix, $marker);
        $response = $this->client->listQueue($request);
        return $this->success('获取队列列表成功', ['queues'=>$response->getQueueNames(), 'nextMarker'=>$response->getNextMarker()]);
    }
758883
def _get_validated_visibility_timeout(self, timeout=None):
        
        if timeout is not None:
            visibility_timeout = int(timeout)
        else:
            visibility_timeout = int(self.querystring.get("VisibilityTimeout")[0])

        if visibility_timeout > MAXIMUM_VISIBILTY_TIMEOUT:
            raise ValueError

        return visibility_timeout
1032262
public function batchDeleteMessage($receiptHandles)
    {
        $successCount = 0;
        foreach ($receiptHandles as $receiptHandle) {
            if ($this->deleteMessage($receiptHandle)) {
                $successCount++;
            }
        }
        return $successCount;
    }
418525
public function get($queueName, array $options = [], callable $callback = null)
    {
        $noAck = array_key_exists('noAck', $options) ? $options['noAck'] : null;

        $outputFrame = Basic\BasicGetFrame::create(
            $queueName,
            $noAck
        );
        $outputFrame->frameChannelId = $this->id;
        $this->connection->command($outputFrame);

        if (is_callable($callback)) {
            $this->on(self::EVENT_DISPATCH_MESSAGE, $callback);
        }
    }
1026329
private function resolveUrl($queueName)
    {
        if (isset($this->queueUrls[$queueName])) {
            return $this->queueUrls[$queueName];
        }

        $result = $this->sqs->getQueueUrl(['QueueName' => $queueName]);

        if ($result && $queueUrl = $result->get('QueueUrl')) {
            return $this->queueUrls[$queueName] = $queueUrl;
        }

        throw new \InvalidArgumentException('Queue "'.$queueName.'" cannot be resolved to an url.');
    }
446295
public function receiveMessage(string $queueName, $amount=1, int $waitSeconds){
        if(!$queueName || !$amount || $waitSeconds < 0 || $waitSeconds > 30){
            return $this->error('参数有误');
        }
        try{
            $responseData = [];
            $queue = $this->client->getQueueRef($queueName);
            if($amount > 1){
                $request = new BatchReceiveMessageRequest($amount, 30);
                $response = $queue->batchReceiveMessage($request);
                foreach ($response->getMessages() as $messageObject){
                    $responseData[] = $this->parseObjectData(Message::class, $messageObject);
                }
            }else{
                $response = $queue->receiveMessage(30);
                $responseData = $this->parseObjectData(ReceiveMessageResponse::class, $response);
            }
            return $this->success('消费消息成功', $responseData);
        }catch (MnsException $exception){
            return $this->parseException($exception, '消费消息');
        }
    }