Comcast / cmb

This project is no longer actively supported. It is made available as read-only. A highly available, horizontally scalable queuing and notification service compatible with AWS SQS and SNS
Apache License 2.0
277 stars 50 forks source link

MessageAttributes support #32

Closed leemhenson closed 9 years ago

leemhenson commented 9 years ago

It looks to me like cmb doesn't support custom MessageAttributes in addition to the normal Attributes (SentTimestamp etc). Is this planned?

See: http://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_Message.html http://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_ReceiveMessage.html http://docs.aws.amazon.com/sns/latest/api/API_Publish.html

leemhenson commented 9 years ago

Looks like this is on master now? I'm going to give it a whirl. :snowboarder:

leemhenson commented 9 years ago

I guess this isn't fully baked yet? I've added them to the ruby example script (see pull request above) but I'm getting a nil from message_attributes in my example:

{
            :message_id => "0:0:0_0_41:2979637976979472444:-5029747869421079692",
        :receipt_handle => "0:0:0_0_41:2979637976979472444:-5029747869421079692",
            :attributes => {
                 "ApproximateReceiveCount" => "1",
                           "SentTimestamp" => "1420802105417",
                                "SenderId" => "420706997018",
        "ApproximateFirstReceiveTimestamp" => "1420802105421"
    },
                  :body => "test",
    :message_attributes => nil
}
boriwo commented 9 years ago

Yes, this feature is experimental and not completed yet. Basic attributes (string, number, binary) may work in cqs already but there's no bridge from cns to cqs yet. Will update here, when it makes sense to try.

boriwo commented 9 years ago

Just checked in the cns part. You can give it a try now. Note that I had to change your ruby script slightly to make it work.

leemhenson commented 9 years ago

:cake: yeah looks good, thanks!