example of params for publishing to an amazon sns topic using node.js -
i'm trying follow along amazon sns publish example using amazon documentation site it's vague on message, messageattributes , messagestructure.
first of all, message property going string if set messagestructure json? e.g. if want send object instead of string message. if it's string - need json.stringify object before passing message property?
http://docs.aws.amazon.com/awsjavascriptsdk/latest/aws/sns.html#publish-property
should doing using messageattributes instead? property - amazon documentation merely states "message attributes publish action" seems tautology.
http://docs.aws.amazon.com/sns/latest/apireference/api_publish.html
setting messagestructure json used if going send json-formatted message structure sns in specific jormat sns understands. used when publishing multiple endpoint types , want vary message body endpoint type. isn't same "i want send message body has been serialized json."
if sending "a json object," need stringify it, , send other (non-json) messages, because sns messages are, fundamentally, strings.
messageattributes else entirely. allow send pseudo-out-of-band key/value pairs along message, can useful example if message has been gzipped , base64 encoded (again, example) attach "external_id" attribute recipient evaluate decide whether needed unpack whole message or discard it.
Comments
Post a Comment