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

SendMessage /:acct/:queue #34

Open
dmjio opened this issue Nov 13, 2015 · 0 comments
Open

SendMessage /:acct/:queue #34

dmjio opened this issue Nov 13, 2015 · 0 comments

Comments

@dmjio
Copy link

dmjio commented Nov 13, 2015

So the according to the AWS spec for SQS (2012-11-05) a SendMessage request has this form.

http://sqs.us-east-1.amazonaws.com/123456789012/testQueue/
?Action=SendMessage
&MessageBody=This+is+a+test+message
&MessageAttribute.1.Name=test_attribute_name_1
&MessageAttribute.1.Value.StringValue=test_attribute_value_1
&MessageAttribute.1.Value.DataType=String
&MessageAttribute.2.Name=test_attribute_name_2
&MessageAttribute.2.Value.StringValue=test_attribute_value_2
&MessageAttribute.2.Value.DataType=String
&Version=2012-11-05
&Expires=2014-05-05T22%3A52%3A43PST
&AUTHPARAMS

You'll notice here the URL looks like this:

http://sqs.us-east-1.amazonaws.com/123456789012/testQueue/
# http://sqs.us-east-1.amazonaws.com/:acctid/:queue

But the sinatra handler we have only accounts for queue name.

post "/:queue" do |queue|
   settings.api.call(action, queue, params)
end

So this causes sinatra to break when I submit requests of that form (i.e. /:acctid/:queue) for SendMessage other things work fine.

The library I'm using, https://github.com/aristidb/aws doesn't allow me to modify the path parameters because the spec should always abide by /:acctid/:qeueue for SendMessage, is there a way I can modify this handler to account for this scenario (and just ignore acctid altogether?).

post "/:acctid/:queue" do |acctid, queue|
   settings.api.call(action, queue, params)
end

Sorry I'm newish to ruby. But is there a way I can generate a new binary based off this additional handler?

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

No branches or pull requests

1 participant