lib/sqs/right_sqs_interface.rb
# Deletes queue then re-creates it (restores attributes also). The fastest method to clear big queue or queue with invisible messages. Return +true+ or an exception.
#
#  sqs.force_clear_queue('http://queue.amazonaws.com/ZZ7XXXYYYBINS/my_awesome_queue') #=> true
#
# PS This function is no longer supported.  Amazon has changed the SQS semantics to require at least 60 seconds between 
# queue deletion and creation. Hence this method will fail with an exception.
#
Deletes queue then re-creates it (restores attributes also). The fastest method to clear big queue or queue with invisible messages. Return +true+ or an exception.

PS This function is no longer supported.  Amazon has changed the SQS semantics to require at least 60 seconds between
queue deletion and creation. Hence this method will fail with an exception.
Deletes queue then re - creates it ( restores attributes also ) . The fastest method to clear big queue or queue with invisible messages . Return + true + or an exception . PS This function is no longer supported . Amazon has changed the SQS semantics to require at least 60 seconds between queue deletion and creation . Hence this method will fail with an exception .
def force_clear_queue(queue_url)
      queue_name       = queue_name_by_url(queue_url)
      queue_attributes = get_queue_attributes(queue_url)
      force_delete_queue(queue_url)
      create_queue(queue_name)
      get_queue_attributes(queue_url)  
      queue_attributes.each{ |attribute, value| set_queue_attributes(queue_url, attribute, value) }
      true
    rescue
      on_exception
    end
def force_clear_queue ( queue_url ) queue_name = queue_name_by_url ( queue_url ) queue_attributes = get_queue_attributes ( queue_url ) force_delete_queue ( queue_url ) create_queue ( queue_name ) get_queue_attributes ( queue_url ) queue_attributes . each { | attribute , value | set_queue_attributes ( queue_url , attribute , value ) } true rescue on_exception end
Deletes queue then re-creates it (restores attributes also).
Deletes queue then re - creates it ( restores attributes also ) .
# hmmm... The next line is a trick. Amazon do not want change attributes immediately after queue creation # So we do 'empty' get_queue_attributes. Probably they need some time to allow attributes change.
queue_url
<not_specific>