public async Task <DeleteQueueResponse> DeleteQueueAsync(string queueUrl, CancellationToken cancellationToken = default) { this.Logger.LogDebug($"[{nameof(this.DeleteQueueAsync)}]"); this.Logger.LogTrace(JsonConvert.SerializeObject(new { queueUrl })); if (string.IsNullOrWhiteSpace(queueUrl)) { throw new ArgumentNullException(nameof(queueUrl)); } var request = new Amazon.SQS.Model.DeleteQueueRequest { QueueUrl = queueUrl, }; this.Logger.LogTrace(JsonConvert.SerializeObject(value: request)); var response = await this.Repository.DeleteQueueAsync(request : request, cancellationToken : cancellationToken == default?this.CancellationToken.Token : cancellationToken); this.Logger.LogTrace(JsonConvert.SerializeObject(value: response)); return(response); }
/// <summary> /// /// This action unconditionally deletes the queue specified by the queue URL. Use this operation WITH CARE! The queue is deleted even if it is NOT empty. /// /// </summary> /// <param name="service">Instance of AmazonSQS service</param> /// <param name="request">DeleteQueueRequest request</param> public static void InvokeDeleteQueue(AmazonSQS service, DeleteQueueRequest request) { try { DeleteQueueResponse response = service.DeleteQueue(request); Console.WriteLine ("Service Response"); Console.WriteLine ("============================================================================="); Console.WriteLine (); Console.WriteLine(" DeleteQueueResponse"); if (response.IsSetResponseMetadata()) { Console.WriteLine(" ResponseMetadata"); ResponseMetadata responseMetadata = response.ResponseMetadata; if (responseMetadata.IsSetRequestId()) { Console.WriteLine(" RequestId"); Console.WriteLine(" {0}", responseMetadata.RequestId); } } } catch (AmazonSQSException ex) { Console.WriteLine("Caught Exception: " + ex.Message); Console.WriteLine("Response Status Code: " + ex.StatusCode); Console.WriteLine("Error Code: " + ex.ErrorCode); Console.WriteLine("Error Type: " + ex.ErrorType); Console.WriteLine("Request ID: " + ex.RequestId); Console.WriteLine("XML: " + ex.XML); } }
public void DeleteQueue(string url) { var req = new DeleteQueueRequest() { QueueUrl = url }; client.DeleteQueue(req); }
public virtual void DeleteQueue(AmazonSQSClient sqsClient, string queueUrl) { var deleteQueueRequest = new DeleteQueueRequest { QueueUrl = queueUrl }; // Delete the queue sqsClient.DeleteQueue(deleteQueueRequest); }
protected override bool Execute(AmazonSQS client) { Logger.LogMessage(MessageImportance.Normal, "Deleting SQS Queue at {0}", QueueUrl); var request = new DeleteQueueRequest { QueueUrl = QueueUrl }; client.DeleteQueue(request); Logger.LogMessage(MessageImportance.Normal, "Deleted SQS Queue at {0}", QueueUrl); return true; }
public string DeleteQueue(Uri queueUri) { queueUri.Requires("queueUri").IsNotNull(); var sqsDeleteRequest = new DeleteQueueRequest(queueUri.AbsoluteUri); try { using (var sqs = amazonSqsFactory()) { var deleteQueueResponse = sqs.DeleteQueue(sqsDeleteRequest); return deleteQueueResponse.ResponseMetadata.RequestId; } } catch (AmazonSQSException) { return null; } }
protected override void EndProcessing() { AmazonSQS client = base.GetClient(); foreach (string queueUrl in this.QueueUrl) { try { DeleteQueueRequest request = new DeleteQueueRequest(); request.QueueUrl = queueUrl; DeleteQueueResponse response = client.DeleteQueue(request); } catch (Exception ex) { ErrorRecord record = new ErrorRecord(ex, null, ErrorCategory.InvalidOperation, queueUrl); WriteError(record); } } }
public object Execute(ExecutorContext context) { var cmdletContext = context as CmdletContext; // create request var request = new Amazon.SQS.Model.DeleteQueueRequest(); if (cmdletContext.QueueUrl != null) { request.QueueUrl = cmdletContext.QueueUrl; } CmdletOutput output; // issue call var client = Client ?? CreateClient(_CurrentCredentials, _RegionEndpoint); try { var response = CallAWSServiceOperation(client, request); object pipelineOutput = null; pipelineOutput = cmdletContext.Select(response, this); output = new CmdletOutput { PipelineOutput = pipelineOutput, ServiceResponse = response }; } catch (Exception e) { output = new CmdletOutput { ErrorResponse = e }; } return(output); }
/// <summary> /// Deletes the queue specified by the <b>queue URL</b>, regardless of whether /// the queue is empty. If the specified queue does not exist, Amazon SQS returns /// a successful response. /// /// <important> /// <para> /// Use <code>DeleteQueue</code> with care; once you delete your queue, any messages /// in the queue are no longer available. /// </para> /// </important> /// <para> /// When you delete a queue, the deletion process takes up to 60 seconds. Requests /// you send involving that queue during the 60 seconds might succeed. For example, /// a <a>SendMessage</a> request might succeed, but after the 60 seconds, the queue /// and that message you sent no longer exist. Also, when you delete a queue, you /// must wait at least 60 seconds before creating a queue with the same name. /// /// </para> /// /// <para> /// We reserve the right to delete queues that have had no activity for more than /// 30 days. For more information, see <a href="http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/SQSConcepts.html">How /// Amazon SQS Queues Work</a> in the <i>Amazon SQS Developer Guide</i>. /// </para> /// </summary> /// <param name="queueUrl">The URL of the Amazon SQS queue to take action on.</param> /// /// <returns>The response from the DeleteQueue service method, as returned by SQS.</returns> public DeleteQueueResponse DeleteQueue(string queueUrl) { var request = new DeleteQueueRequest(); request.QueueUrl = queueUrl; return DeleteQueue(request); }
/// <summary> /// Deletes the queue specified by the <code>QueueUrl</code>, even if the queue is empty. /// If the specified queue doesn't exist, Amazon SQS returns a successful response. /// /// <important> /// <para> /// Be careful with the <code>DeleteQueue</code> action: When you delete a queue, any /// messages in the queue are no longer available. /// </para> /// </important> /// <para> /// When you delete a queue, the deletion process takes up to 60 seconds. Requests you /// send involving that queue during the 60 seconds might succeed. For example, a <code> /// <a>SendMessage</a> </code> request might succeed, but after 60 seconds the queue and /// the message you sent no longer exist. /// </para> /// /// <para> /// When you delete a queue, you must wait at least 60 seconds before creating a queue /// with the same name. /// </para> /// </summary> /// <param name="queueUrl">The URL of the Amazon SQS queue to delete. Queue URLs are case-sensitive.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the DeleteQueue service method, as returned by SQS.</returns> public Task<DeleteQueueResponse> DeleteQueueAsync(string queueUrl, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var request = new DeleteQueueRequest(); request.QueueUrl = queueUrl; return DeleteQueueAsync(request, cancellationToken); }
/// <summary> /// Initiates the asynchronous execution of the DeleteQueue operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DeleteQueue operation.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// <returns>The task object representing the asynchronous operation.</returns> public Task<DeleteQueueResponse> DeleteQueueAsync(DeleteQueueRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new DeleteQueueRequestMarshaller(); var unmarshaller = DeleteQueueResponseUnmarshaller.Instance; return InvokeAsync<DeleteQueueRequest,DeleteQueueResponse>(request, marshaller, unmarshaller, cancellationToken); }
public DeleteQueueResponse DeleteQueue(DeleteQueueRequest request) { FakeSqsQueue q; queues.TryRemove(request.QueueUrl, out q); return new DeleteQueueResponse(); }
IAsyncResult invokeDeleteQueue(DeleteQueueRequest deleteQueueRequest, AsyncCallback callback, object state, bool synchronized) { IRequest irequest = new DeleteQueueRequestMarshaller().Marshall(deleteQueueRequest); var unmarshaller = DeleteQueueResponseUnmarshaller.GetInstance(); AsyncResult result = new AsyncResult(irequest, callback, state, synchronized, signer, unmarshaller); Invoke(result); return result; }
/// <summary> /// Initiates the asynchronous execution of the DeleteQueue operation. /// <seealso cref="Amazon.SQS.IAmazonSQS.DeleteQueue"/> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DeleteQueue operation.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// <returns>The task object representing the asynchronous operation.</returns> public async Task<DeleteQueueResponse> DeleteQueueAsync(DeleteQueueRequest request, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new DeleteQueueRequestMarshaller(); var unmarshaller = DeleteQueueResponseUnmarshaller.GetInstance(); var response = await Invoke<IRequest, DeleteQueueRequest, DeleteQueueResponse>(request, marshaller, unmarshaller, signer, cancellationToken) .ConfigureAwait(continueOnCapturedContext: false); return response; }
/// <summary> /// <para> Deletes the queue specified by the <b>queue URL</b> , regardless of whether the queue is empty. If the specified queue does not /// exist, Amazon SQS returns a successful response. </para> <para><b>IMPORTANT:</b> Use DeleteQueue with care; once you delete your queue, any /// messages in the queue are no longer available. </para> <para> When you delete a queue, the deletion process takes up to 60 seconds. Requests /// you send involving that queue during the 60 seconds might succeed. For example, a SendMessage request might succeed, but after the 60 /// seconds, the queue and that message you sent no longer exist. Also, when you delete a queue, you must wait at least 60 seconds before /// creating a queue with the same name. </para> <para> We reserve the right to delete queues that have had no activity for more than 30 days. /// For more information, see <a href="http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/SQSConcepts.html">How Amazon /// SQS Queues Work</a> in the <i>Amazon SQS Developer Guide</i> . /// </para> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DeleteQueue service method on AmazonSQS.</param> public DeleteQueueResponse DeleteQueue(DeleteQueueRequest request) { var task = DeleteQueueAsync(request); try { return task.Result; } catch(AggregateException e) { ExceptionDispatchInfo.Capture(e.InnerException).Throw(); return null; } }
internal DeleteQueueResponse DeleteQueue(DeleteQueueRequest request) { var task = DeleteQueueAsync(request); try { return task.Result; } catch(AggregateException e) { throw e.InnerException; } }
public static void SQSDeleteQueue() { #region SQSDeleteQueue var client = new AmazonSQSClient(); var request = new DeleteQueueRequest { QueueUrl = "https://sqs.us-east-1.amazonaws.com/80398EXAMPLE/MyTestQueue" }; client.DeleteQueue(request); #endregion }
/// <summary> /// Deletes the queue specified by the <b>queue URL</b>, regardless of whether the queue /// is empty. If the specified queue does not exist, Amazon SQS returns a successful response. /// /// /// <important> /// <para> /// Use <code>DeleteQueue</code> with care; once you delete your queue, any messages /// in the queue are no longer available. /// </para> /// </important> /// <para> /// When you delete a queue, the deletion process takes up to 60 seconds. Requests you /// send involving that queue during the 60 seconds might succeed. For example, a <a>SendMessage</a> /// request might succeed, but after the 60 seconds, the queue and that message you sent /// no longer exist. Also, when you delete a queue, you must wait at least 60 seconds /// before creating a queue with the same name. /// </para> /// /// <para> /// We reserve the right to delete queues that have had no activity for more than 30 /// days. For more information, see <a href="http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/SQSConcepts.html">How /// Amazon SQS Queues Work</a> in the <i>Amazon SQS Developer Guide</i>. /// </para> /// </summary> /// <param name="queueUrl">The URL of the Amazon SQS queue to take action on.</param> /// <param name="options"> /// A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback /// procedure using the AsyncState property. /// </param> /// /// <returns>The response from the DeleteQueue service method, as returned by SQS.</returns> public void DeleteQueueAsync(string queueUrl, AmazonServiceCallback<DeleteQueueRequest, DeleteQueueResponse> callback, AsyncOptions options = null) { var request = new DeleteQueueRequest(); request.QueueUrl = queueUrl; DeleteQueueAsync(request, callback, options); }
/// <summary> /// Deletes the SQS Queue /// </summary> /// <param name="queueUrl"></param> public void DeleteQueue(string queueUrl) { var request = new DeleteQueueRequest { QueueUrl = queueUrl }; Client.DeleteQueue(request); }
public override void DeleteQueue(string queue) { DeleteQueueRequest request = new DeleteQueueRequest(); request.QueueUrl = GetQueueUrl(SanitiseQueueName(queue)); DeleteQueueResponse response = client.DeleteQueue(request); }
private void btnDeleteQueue_Click(object sender, RoutedEventArgs e) { DeleteQueueRequest request = new DeleteQueueRequest(); request.QueueUrl = (string.Format(CultureInfo.InvariantCulture, "{0}/{1}/{2}", QueueServiceURL, QueuePath, QueueName.Trim())); this.Dispatcher.BeginInvoke(() => { this.MessageDeletedNotification = "Please wait..."; }); sqs.OnSQSResponse += GetDeleteQueueResponse; sqs.DeleteQueue(request); }
public Task<DeleteQueueResponse> DeleteQueueAsync(DeleteQueueRequest request, CancellationToken cancellationToken = new CancellationToken()) { throw new NotImplementedException(); }
/// <summary> /// Deletes the queue specified by the <b>queue URL</b>, regardless of whether /// the queue is empty. If the specified queue does not exist, Amazon SQS returns /// a successful response. /// /// <important> /// <para> /// Use <code>DeleteQueue</code> with care; once you delete your queue, any messages /// in the queue are no longer available. /// </para> /// </important> /// <para> /// When you delete a queue, the deletion process takes up to 60 seconds. Requests /// you send involving that queue during the 60 seconds might succeed. For example, /// a <a>SendMessage</a> request might succeed, but after the 60 seconds, the queue /// and that message you sent no longer exist. Also, when you delete a queue, you /// must wait at least 60 seconds before creating a queue with the same name. /// /// </para> /// /// <para> /// We reserve the right to delete queues that have had no activity for more than /// 30 days. For more information, see <a href="http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/SQSConcepts.html">How /// Amazon SQS Queues Work</a> in the <i>Amazon SQS Developer Guide</i>. /// </para> /// </summary> /// <param name="request">Container for the necessary parameters to execute the DeleteQueue service method.</param> /// /// <returns>The response from the DeleteQueue service method, as returned by SQS.</returns> public DeleteQueueResponse DeleteQueue(DeleteQueueRequest request) { var marshaller = new DeleteQueueRequestMarshaller(); var unmarshaller = DeleteQueueResponseUnmarshaller.Instance; return Invoke<DeleteQueueRequest,DeleteQueueResponse>(request, marshaller, unmarshaller); }
IAsyncResult invokeDeleteQueue(DeleteQueueRequest request, AsyncCallback callback, object state, bool synchronized) { var marshaller = new DeleteQueueRequestMarshaller(); var unmarshaller = DeleteQueueResponseUnmarshaller.Instance; return Invoke(request, callback, state, synchronized, marshaller, unmarshaller, signer); }
/// <summary> /// Initiates the asynchronous execution of the DeleteQueue operation. /// <seealso cref="Amazon.SQS.IAmazonSQS"/> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DeleteQueue operation on AmazonSQSClient.</param> /// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param> /// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback /// procedure using the AsyncState property.</param> /// /// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndDeleteQueue /// operation.</returns> public IAsyncResult BeginDeleteQueue(DeleteQueueRequest request, AsyncCallback callback, object state) { var marshaller = new DeleteQueueRequestMarshaller(); var unmarshaller = DeleteQueueResponseUnmarshaller.Instance; return BeginInvoke<DeleteQueueRequest>(request, marshaller, unmarshaller, callback, state); }
/// <summary> /// <para>This action unconditionally deletes the queue specified by the queue URL. Use this operation WITH CARE! The queue is deleted even if /// it is NOT empty.</para> <para>Once a queue has been deleted, the queue name is unavailable for use with new queues for 60 seconds.</para> /// </summary> /// /// <param name="deleteQueueRequest">Container for the necessary parameters to execute the DeleteQueue service method on AmazonSQS.</param> /// public DeleteQueueResponse DeleteQueue(DeleteQueueRequest deleteQueueRequest) { IAsyncResult asyncResult = invokeDeleteQueue(deleteQueueRequest, null, null, true); return EndDeleteQueue(asyncResult); }
/// <summary> /// Deletes a SQS message queue. /// </summary> /// <param name="deleteQueueRequest">The delete queue request.</param> /// <returns>The delete queue response.</returns> public virtual DeleteQueueResponse DeleteQueue(DeleteQueueRequest deleteQueueRequest) { if (deleteQueueRequest == null) { throw new ArgumentNullException("deleteQueueRequest"); } // Log.DebugFormat("SqsClient: Deleting queue: {0}.", deleteQueueRequest.QueueUrl); return this.Client.DeleteQueue(deleteQueueRequest); }
/// <summary> /// Initiates the asynchronous execution of the DeleteQueue operation. /// <seealso cref="Amazon.SQS.IAmazonSQS.DeleteQueue"/> /// </summary> /// /// <param name="deleteQueueRequest">Container for the necessary parameters to execute the DeleteQueue operation on AmazonSQS.</param> /// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param> /// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback /// procedure using the AsyncState property.</param> public IAsyncResult BeginDeleteQueue(DeleteQueueRequest deleteQueueRequest, AsyncCallback callback, object state) { return invokeDeleteQueue(deleteQueueRequest, callback, state, false); }
private void DeleteQueue(SqsQueueName queueName, string queueUrl) { var request = new DeleteQueueRequest { QueueUrl = queueUrl }; var response = SqsClient.DeleteQueue(request); SqsQueueDefinition qd; queueNameMap.TryRemove(queueName.QueueName, out qd); }
/// <summary> /// Initiates the asynchronous execution of the DeleteQueue operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DeleteQueue operation on AmazonSQSClient.</param> /// <param name="callback">An Action delegate that is invoked when the operation completes.</param> /// <param name="options">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback /// procedure using the AsyncState property.</param> public void DeleteQueueAsync(DeleteQueueRequest request, AmazonServiceCallback<DeleteQueueRequest, DeleteQueueResponse> callback, AsyncOptions options = null) { options = options == null?new AsyncOptions():options; var marshaller = new DeleteQueueRequestMarshaller(); var unmarshaller = DeleteQueueResponseUnmarshaller.Instance; Action<AmazonWebServiceRequest, AmazonWebServiceResponse, Exception, AsyncOptions> callbackHelper = null; if(callback !=null ) callbackHelper = (AmazonWebServiceRequest req, AmazonWebServiceResponse res, Exception ex, AsyncOptions ao) => { AmazonServiceResult<DeleteQueueRequest,DeleteQueueResponse> responseObject = new AmazonServiceResult<DeleteQueueRequest,DeleteQueueResponse>((DeleteQueueRequest)req, (DeleteQueueResponse)res, ex , ao.State); callback(responseObject); }; BeginInvoke<DeleteQueueRequest>(request, marshaller, unmarshaller, options, callbackHelper); }
/// <summary> /// <para>This action unconditionally deletes the queue specified by the queue URL. Use this operation WITH CARE! The queue is deleted even if /// it is NOT empty.</para> <para>Once a queue has been deleted, the queue name is unavailable for use with new queues for 60 seconds.</para> /// </summary> /// /// <param name="deleteQueueRequest">Container for the necessary parameters to execute the DeleteQueue service method on AmazonSQS.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> public Task<DeleteQueueResponse> DeleteQueueAsync(DeleteQueueRequest deleteQueueRequest, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new DeleteQueueRequestMarshaller(); var unmarshaller = DeleteQueueResponseUnmarshaller.GetInstance(); return Invoke<IRequest, DeleteQueueRequest, DeleteQueueResponse>(deleteQueueRequest, marshaller, unmarshaller, signer, cancellationToken); }
private Amazon.SQS.Model.DeleteQueueResponse CallAWSServiceOperation(IAmazonSQS client, Amazon.SQS.Model.DeleteQueueRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon Simple Queue Service (SQS)", "DeleteQueue"); try { #if DESKTOP return(client.DeleteQueue(request)); #elif CORECLR return(client.DeleteQueueAsync(request).GetAwaiter().GetResult()); #else #error "Unknown build edition" #endif } catch (AmazonServiceException exc) { var webException = exc.InnerException as System.Net.WebException; if (webException != null) { throw new Exception(Utils.Common.FormatNameResolutionFailureMessage(client.Config, webException.Message), webException); } throw; } }