Skip to content

Support QueueUrl Plugin override #2148

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

Closed
wants to merge 1 commit into from
Closed

Support QueueUrl Plugin override #2148

wants to merge 1 commit into from

Conversation

cjyclaire
Copy link
Contributor

@cjyclaire cjyclaire commented Oct 29, 2019

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Addressing #2114

Aws::SQS::Client.new(disable_queue_url_override: true)

will disable endpoint and region override from the :queue _url provided

Note:

Pending on sync with Java team

@cjyclaire cjyclaire requested a review from mullermp October 29, 2019 18:11
@cjyclaire
Copy link
Contributor Author

CI passing the 2.1 failing is transient issue as it's succeeding in the other run

@harihara-n
Copy link
Contributor

harihara-n commented Oct 29, 2019

I wonder if we could do something like the following, rather than having to disable the plugin through a flag.

In the queue_url plugin, we check if an endpoint is provided by the end user. If not, then go ahead and update the endpoint and region based on the queue_url. If yes, then do not make those changes.

That would make it easier to use custom endpoints, rather than having to remember to pass in disable_queue_url_override as well.

@cjyclaire
Copy link
Contributor Author

@hhk1989 Thanks for the feedback! Appreciate that, personally thought about that too, was hesitate to do so because it could potentially breaking people providing a customized endpoint but depending on current overwrite, it's hard to tell who might be replying on this behavior. Adding an option would make it safer for people who are certain that they want to enable this behavior.

In the next major version (where breaking changes are allowed), we probably should consider making this override turned off by default when customized endpoint is provided. Thoughts?

@harihara-n
Copy link
Contributor

That's a fair point, it's prudent to not break existing workflows. However, could we also keep this consistent for the Java SDK ? As in for now, we introduce the disable_queue_url_override option, but in the next major version we turn it off by default when custom endpoint is provided.

@cjyclaire
Copy link
Contributor Author

@hhk1989 Sounds good! I will sync with Java team to make sure we are on the same page

class Handler < Seahorse::Client::Handler

def call(context)
if queue_url = context.params[:queue_url]
disable = !!context.config.disable_queue_url_override
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Avoid use of double negation (as per Rubocop). Use .nil?

it 'does not override endpoint and region when disabled' do
endpoint = 'https://vpc-123234.sqs.us-west-2.vpc.amazonaws.com'
url = 'https://sqs.us-east-1.amazonaws.com/1234567890/demo'
client = Client.new(stub_responses: true, endpoint: endpoint, disable_queue_url_override: true)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check for 80 chars!

@cjyclaire cjyclaire added investigating Issue is being investigated needs-design labels Oct 29, 2019
@cjyclaire
Copy link
Contributor Author

closing, will create a separate PR for tracking as the issue is queue url plugin is parsing out the wrong region from vpc endpoint queue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
investigating Issue is being investigated
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants