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

Message attributes seem to be ignored. #24

Open
mvmn opened this issue Mar 20, 2017 · 5 comments
Open

Message attributes seem to be ignored. #24

mvmn opened this issue Mar 20, 2017 · 5 comments

Comments

@mvmn
Copy link

mvmn commented Mar 20, 2017

It seems message attributes are not propagated when message is sent to http or SQS subscription.

@mattwcole
Copy link

I have noticed this when using elasticmq. Sending a message with attributes directly to the queue does work, but not via sns.

@mattwcole
Copy link

Actually it is working. Raw message delivery must be enabled. You have to add the following to your subscription json:

"subscriptionAttributes": {
  "RawMessageDelivery": "true"
}

@paul-cummings
Copy link

Is it possible to enable a filter policy on a subscription?

Use case: publish to a topic a message with attribute "cluster:c1" to be received by subscription with a filter policy "cluster:c1".

I've tried implementing filter policy into the subscriptions json but the message seems to be received by all queues subscribed to the topic.

Command used to publish message:
aws sns --endpoint-url http://localhost:4575 publish --topic-arn "<topic-arn>" --message "Hello c1" --message-attributes '{ "cluster":{ "DataType":"String","StringValue":"c1" }}'

Example subscription json:
"subscriptions": [ { "arn": "<arn>", "owner": "", "protocol": "sqs", "endpoint": "<endpoint>", "topicArn": "<topic-arn>", "RawMessageDelivery": "true", "filterPolicy": { "cluster": ["c1"] } },

@forsen
Copy link

forsen commented Dec 29, 2022

Actually it is working. Raw message delivery must be enabled. You have to add the following to your subscription json:

"subscriptionAttributes": {
  "RawMessageDelivery": "true"
}

But if "Raw message delivery" is disabled, the attributes should still appear in the message body.

@jameskbride
Copy link

Hello and apologies for the self-advertisement, I've created local-sns as a reimplementation of this project, which includes Message Attribute support. See jameskbride/local-sns#21 for more details.

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

5 participants