List of usage examples for com.amazonaws.services.sqs.model PurgeQueueRequest getRequestClientOptions
public RequestClientOptions getRequestClientOptions()
From source file:com.amazon.sqs.javamessaging.AmazonSQSExtendedClient.java
License:Open Source License
/** * <p>/*from w w w . java2 s.c o m*/ * 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. * * * @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 void 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); super.purgeQueue(purgeQueueRequest); }