Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8690105
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T23:49:55+00:00 2026-06-12T23:49:55+00:00

could someone help with an example how to change visibility timeout for an sqs

  • 0

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

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T23:49:56+00:00Added an answer on June 12, 2026 at 11:49 pm

    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):

    messages = []
    messages << { :message => 'handle1', :visibility_timeout => 5 }
    messages << { :message => 'handle2', :visibility_timeout => 10 }
    
    queue.batch_change_visibility(*messages)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm relatively new to Cocoa/ObjC. Could someone please help me change my code to
Could someone help me understand the primitive accessors with this example : i don't
Could someone help me on this, I have created simple web services using axis2
I was hoping someone could help me figure out how to change the setmessage
Could someone please help me with the regexp javascript code to replace all <br
I was wondering if someone could post an example using PyPNG to read a
Could someone help me to add A-atype B-btype C-ctype ONLY as a legend to
Could someone help me to write a function that checks if a string is
Could someone help me to write a logic that converts a ID array to
could someone help me on this problem, i want to access facebook API through

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.