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

Allow SQS SendMessage parameters to be specified when using ActiveJob #648

Merged

Conversation

cjlarose
Copy link
Collaborator

@cjlarose cjlarose commented Jan 31, 2021

Adds support for specifying SQS SendMessage parameters as described in #646

For example,

class MyJob < ApplicationJob
  def perform(a, b); end
end

MyJob.set(message_group_id: 'abc123',
          message_deduplication_id: 'dedupe',
          message_attributes: {
            'key' => {
              string_value: 'myvalue',
              data_type: 'String'
            }
          })
     .perform_later(123, 'abc')

The `options` parameter of the `enqueue` method of both Shoryuken
ActiveJob queue adapters is undocumented and not recommended for use,
but we'll add tests to ensure it doesn't break for folks that are using
it anyway.
We'll use this spec to ensure that when jobs are enqueued from
ActiveJob::Base worker classes, the expected parameters are passed to
the Shoryuken queue_adapter
This change will be important in making it so that the SendMessage
parameters can be specified using .set.
@cjlarose cjlarose force-pushed the active-job-sqs-send-message-parameters branch from f2fb025 to 0992961 Compare February 1, 2021 07:59
@cjlarose cjlarose merged commit c5e9eb1 into ruby-shoryuken:master Feb 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant