Skip to content

SendMessage /:acct/:queue #34

@dmjio

Description

@dmjio

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions