Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add sqs url to shared sqs queue resource #289

Merged
merged 1 commit into from Jun 8, 2019

Conversation

Projects
None yet
1 participant
@tongueroo
Copy link
Owner

commented Jun 8, 2019

This is a 🐞 bug fix.
This is a πŸ™‹β€β™‚οΈ feature or enhancement.

  • I've added tests (if it's a bug, feature or enhancement)
  • I've adjusted the documentation (if it's a feature or enhancement)
  • The test suite passes (run bundle exec rspec to verify this)

Summary

Add sqs url to shared sqs queue resource output. This allows us to grab the sqs url programatically. Example: List.lookup(:waitlist_url).

app/shared/resources/list.rb:

class List < Jets::Stack
  sqs_queue(:waitlist)
end

app/jobs/hard_job.rb:

class HardJob < ApplicationJob
  class_timeout 30 # must be less than or equal to the SQS queue default timeout
  depends_on :list # so we can reference list shared resources
  sqs_event ref(:waitlist) # reference sqs queue in shared resource
  def fix
    puts "fix #{JSON.dump(event)}"
    puts "sqs arn: #{List.lookup(:waitlist)}"
    puts "sqs url: #{List.lookup(:waitlist_url)}"
  end
end

Also:

  • fix bug with camelize of the shared resource class name, not using using singularize
  • also fix sqs event docs

Context

https://community.rubyonjets.com/t/sqs-queues-and-messages/187

Version Changes

@tongueroo tongueroo merged commit a210c58 into master Jun 8, 2019

1 check passed

ci/circleci Your tests passed on CircleCI!
Details

@tongueroo tongueroo deleted the sqs-url branch Jun 8, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.