could someone help with an example how to change visibility timeout for an sqs message using ruby aws-sdk ?
here is the code that I’ve used for my tests using the method batch_change_message_visibility, but I get the error “undefined method ‘batch_change_message_visibility'”
require 'rubygems'
require 'aws-sdk'
sqs = AWS::SQS.new(
:access_key_id => access_key,
:secret_access_key => access_secret)
queue = sqs.queues.named(queue_name)
messages = []
messages << { :message => message_handle, :visibility_timeout => 5 }
queue.batch_change_message_visibility(messages)
Any Idea? Any help would the very welcome 🙂
Thanks
You have to use the splat operator when passing the messages array parameter to the batch_change_message_visibility method.
As shown in the docs here, you should write (note the * before the messages parameter):