• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java PurgeQueueRequest类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.amazonaws.services.sqs.model.PurgeQueueRequest的典型用法代码示例。如果您正苦于以下问题:Java PurgeQueueRequest类的具体用法?Java PurgeQueueRequest怎么用?Java PurgeQueueRequest使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



PurgeQueueRequest类属于com.amazonaws.services.sqs.model包,在下文中一共展示了PurgeQueueRequest类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: testPurgeQueue_shouldRemoveAll

import com.amazonaws.services.sqs.model.PurgeQueueRequest; //导入依赖的package包/类
@Test
public void testPurgeQueue_shouldRemoveAll() {
  // create queue
  CreateQueueResult createdQueue = sqs.createQueue(new CreateQueueRequest().withQueueName("tea-earl-grey-queue"));
  // send messages
  String messageBody = "{\"life-universe-everything\":42}";
  sqs.sendMessage(new SendMessageRequest().withDelaySeconds(0).withMessageBody(messageBody)
      .withMessageGroupId("some-group-id-123").withQueueUrl(createdQueue.getQueueUrl()));
  String messageBody2 = "{\"dead-emptyness-nothing\":24}";
  sqs.sendMessage(new SendMessageRequest().withDelaySeconds(0).withMessageBody(messageBody2)
      .withMessageGroupId("some-group-id-123").withQueueUrl(createdQueue.getQueueUrl()));
  
  // purge queues
  PurgeQueueResult result = sqs.purgeQueue(new PurgeQueueRequest().withQueueUrl(createdQueue.getQueueUrl()));
  assertNotNull("verify that purge queue returned ok", result);
  
  // verify empty queue
  ReceiveMessageResult messageResult = sqs.receiveMessage(new ReceiveMessageRequest()
      .withMaxNumberOfMessages(9).withQueueUrl(createdQueue.getQueueUrl()).withVisibilityTimeout(10)
      .withWaitTimeSeconds(0));
  assertEquals("verify that queue is empty", 0, messageResult.getMessages().size());
  
  // cleanup
  getQueues().remove("tea-earl-grey-queue");
}
 
开发者ID:daflockinger,项目名称:unitstack,代码行数:26,代码来源:MockSqsTest.java


示例2: produceMsg

import com.amazonaws.services.sqs.model.PurgeQueueRequest; //导入依赖的package包/类
public void produceMsg(String[] msgs, boolean purgeFirst) throws Exception
{
  CreateQueueResult res = sqs.createQueue(getCurrentQueueName());
  if (purgeFirst) {
    PurgeQueueRequest purgeReq = new PurgeQueueRequest(res.getQueueUrl());
    sqs.purgeQueue(purgeReq);
  }
  for (String text : msgs) {
    sqs.sendMessage(res.getQueueUrl(), text);
  }
}
 
开发者ID:apache,项目名称:apex-malhar,代码行数:12,代码来源:SQSTestBase.java


示例3: purgeQueue

import com.amazonaws.services.sqs.model.PurgeQueueRequest; //导入依赖的package包/类
@Override
public PurgeQueueResult purgeQueue(PurgeQueueRequest purgeQueueRequest) {
    DirectorySQSQueue queue = getQueueFromUrl(purgeQueueRequest.getQueueUrl(), false);
    try {
        queue.purge();
        return new PurgeQueueResult();
    } catch (IOException e) {
        throw new AmazonServiceException("Could not purge queue: " + queue.getQueuePath());
    }
}
 
开发者ID:bazaarvoice,项目名称:awslocal,代码行数:11,代码来源:DirectorySQS.java


示例4: willNotReceiveAfterPurged

import com.amazonaws.services.sqs.model.PurgeQueueRequest; //导入依赖的package包/类
public void willNotReceiveAfterPurged()
        throws InterruptedException {
    final String queueUrl = someNewQueue();

    for (int i = 0; i < 3; i++) {
        _amazonSQS.sendMessage(new SendMessageRequest(queueUrl, someMessageBody()));
    }

    _amazonSQS.purgeQueue(new PurgeQueueRequest(queueUrl));

    sleep(1);

    verifyReceiveNone(queueUrl);
}
 
开发者ID:bazaarvoice,项目名称:awslocal,代码行数:15,代码来源:TestSQSClient.java


示例5: testPurgeQueue_withEmptyRequestParams_shouldWork

import com.amazonaws.services.sqs.model.PurgeQueueRequest; //导入依赖的package包/类
@Test
public void testPurgeQueue_withEmptyRequestParams_shouldWork() {
  assertNotNull(sqs.purgeQueue(new PurgeQueueRequest()));
}
 
开发者ID:daflockinger,项目名称:unitstack,代码行数:5,代码来源:MockSqsTest.java


示例6: purgeQueueAsync

import com.amazonaws.services.sqs.model.PurgeQueueRequest; //导入依赖的package包/类
public Observable<PurgeQueueResult> purgeQueueAsync(PurgeQueueRequest request) {
    return Observable.from(sqsClient.purgeQueueAsync(request));
}
 
开发者ID:gregwhitaker,项目名称:reactive-sqs-client,代码行数:4,代码来源:ReactiveSqsClient.java


示例7: before

import com.amazonaws.services.sqs.model.PurgeQueueRequest; //导入依赖的package包/类
@Override protected void before() {
  if (client != null && queueUrl != null) {
    client.purgeQueue(new PurgeQueueRequest(queueUrl));
  }
}
 
开发者ID:openzipkin,项目名称:zipkin-aws,代码行数:6,代码来源:AmazonSQSRule.java


示例8: purgeQueue

import com.amazonaws.services.sqs.model.PurgeQueueRequest; //导入依赖的package包/类
/**
    * <p>
    * Deletes the messages in a queue specified by the <b>queue URL</b> .
    * </p>
    * <p>
    * <b>IMPORTANT:</b>When you use the PurgeQueue API, the deleted messages in
    * the queue cannot be retrieved.
    * </p>
    * <p>
    * <b>IMPORTANT:</b> This does not delete the message payloads from Amazon S3.
    * </p>
    * <p>
    * When you purge a queue, the message deletion process takes up to 60
    * seconds. All messages sent to the queue before calling
    * <code>PurgeQueue</code> will be deleted; messages sent to the queue while
    * it is being purged may be deleted. While the queue is being purged,
    * messages sent to the queue before <code>PurgeQueue</code> was called may
    * be received, but will be deleted within the next minute.
    * </p>
    *
    * @param purgeQueueRequest
    *            Container for the necessary parameters to execute the
    *            PurgeQueue service method on AmazonSQS.
    * @return The response from the PurgeQueue service method, as returned
    *         by AmazonSQS.
    *
    * @throws AmazonClientException
    *             If any internal errors are encountered inside the client
    *             while attempting to make the request or handle the response.
    *             For example if a network connection is not available.
    * @throws AmazonServiceException
    *             If an error response is returned by AmazonSQS indicating
    *             either a problem with the data in the request, or a server
    *             side issue.
    */
public PurgeQueueResult purgeQueue(PurgeQueueRequest purgeQueueRequest)
		throws AmazonServiceException, AmazonClientException {
	LOG.warn("Calling purgeQueue deletes SQS messages without deleting their payload from S3.");

	if (purgeQueueRequest == null) {
		String errorMessage = "purgeQueueRequest cannot be null.";
		LOG.error(errorMessage);
		throw new AmazonClientException(errorMessage);
	}

	purgeQueueRequest.getRequestClientOptions().appendUserAgent(SQSExtendedClientConstants.USER_AGENT_HEADER);

	return super.purgeQueue(purgeQueueRequest);
}
 
开发者ID:awslabs,项目名称:amazon-sqs-java-extended-client-lib,代码行数:50,代码来源:AmazonSQSExtendedClient.java


示例9: purgeQueue

import com.amazonaws.services.sqs.model.PurgeQueueRequest; //导入依赖的package包/类
/**
 * <p>
 * Deletes the messages in a queue specified by the <b>queue URL</b> .
 * </p>
 * <p>
 * <b>IMPORTANT:</b>When you use the PurgeQueue API, the deleted messages in
 * the queue cannot be retrieved.
 * </p>
 * <p>
 * When you purge a queue, the message deletion process takes up to 60
 * seconds. All messages sent to the queue before calling
 * <code>PurgeQueue</code> will be deleted; messages sent to the queue while
 * it is being purged may be deleted. While the queue is being purged,
 * messages sent to the queue before <code>PurgeQueue</code> was called may
 * be received, but will be deleted within the next minute.
 * </p>
 *
 * @param purgeQueueRequest
 *            Container for the necessary parameters to execute the
 *            PurgeQueue service method on AmazonSQS.
 * 
 * 
 * @throws PurgeQueueInProgressException
 * @throws QueueDoesNotExistException
 *
 * @throws AmazonClientException
 *             If any internal errors are encountered inside the client
 *             while attempting to make the request or handle the response.
 *             For example if a network connection is not available.
 * @throws AmazonServiceException
 *             If an error response is returned by AmazonSQS indicating
 *             either a problem with the data in the request, or a server
 *             side issue.
 */
public PurgeQueueResult purgeQueue(PurgeQueueRequest purgeQueueRequest)
		throws AmazonServiceException, AmazonClientException {

	return amazonSqsToBeExtended.purgeQueue(purgeQueueRequest);

}
 
开发者ID:awslabs,项目名称:amazon-sqs-java-extended-client-lib,代码行数:41,代码来源:AmazonSQSExtendedClientBase.java



注:本文中的com.amazonaws.services.sqs.model.PurgeQueueRequest类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Locator类代码示例发布时间:2022-05-23
下一篇:
Java LinearLocation类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap