-
Notifications
You must be signed in to change notification settings - Fork 27
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
Need a way to pass Subject for the SNS payload #72
Comments
Hey @MythosRaconteur - thanks for posting. Let me have a think about this over the weekend and try and work something out. Thanks. |
Hey there, I actually pulled my change out of your code and decided to parse the TopicArn for the value. It works fine, but it would be nice if there was a raw value on the JSON object, however that is affected. Cheers, C |
Hi Guys What if any "subject" from the payload hash was used as the SNS topic subject? Propono.publish(
'user',
{
subject: 'my subject'
entity: 'user',
action: 'created',
id: user.id,
}
) I'm thinking that if we add a parameter to publish and use that as the SNS topic subject, it wouldn't be available when reading the message off the SQS queue. That would seem odd to me if I wasn't using lambdas. But having it in the payload there is nothing lost when using pub/sub via the SQS queues. Great suggestion @MythosRaconteur :-) Malc |
@malcyL Yeah - I like that idea. My only concern is if We could do both, so you can specify Thoughts? |
@iHiD I wonder if both are overkill. I was trying to make it simpler, but two mechanisms and a flag are making it more complicated. Maybe the subject parameter on publish is the way to go. I was trying to think of a way for the subject to still be available when you are consuming the messages via Propono.listen_to_queue, but maybe that's not important? From just an API perspective, ignoring how it's implemented, we will have a subject added to publish which is then never exposed when reading. Unless your using lambdas of course! But I don't want to over complicate it. An optional parameter on publish is more desirable than two mechanisms in my opinion. |
Did mean to open a can of worms. ;) At the end of the day, it is simple enough to split the TopicArn and pull the topic off the end, but it would be convenient if you could just get it directly from its own key. Is "Subject" on the SNS payload ever used, and if so, what is it intended to be? Barring the use of that key, perhaps the answer is to just inject "Topic" at the same level? |
@MythosRaconteur No can of worms - discussion is always good. 🙂 |
Hello. v2 is now released and I'm in Propono mindset. Do I need to do anything here? :) |
I worked around it. Might be nice to expose it more easily, but does not seem to be much need beyond my own, so I would be fine either way.
Cheers,
C
… On Sep 29, 2017, at 5:00 AM, Jeremy Walker ***@***.***> wrote:
Hello. v2 is now released and I'm in Propono mindset. Do I need to do anything here? :)
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#72 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AAi5ExBNZuTmeuGwrs1yiUmbWUT9nppIks5snNvfgaJpZM4Odes_>.
|
Hey Jeremy,
Apologies if this is the wrong place to put this, but I wasn't sure where to make the request.
I am using Propono to publish SNS messages, and then consuming them with Lambdas that integrate with various 3rd party services (like Slack, and many others).
Our topics are notifiable elements (essentially business objects), with one Lambda acting as a message broker, figuring out which integration to hit, via resubmission of a SNS package against a modified topic. The modified topic is the original topic plus the integration (i.e. user-slack).
The "Slack" Lambda is triggered from that message and fires of a message to Slack.
My issue is that I need the original path accessible to the broker Lambda, and while I could parse the ARN, it would be much easier to just use the Subject of the SNS package, which seems to always be nil with Propono-generated messages.
I altered the services/publisher.rb script by passing options to the sns.publish method:
While this works, it would, obviously, be better if it were actually parameterized so I could pass it in with the call to Propono.publish and not have to mod your code.
Is there any issue you see with this? If not, I can put it together in a pull and send it up.
Cheers,
Chris
The text was updated successfully, but these errors were encountered: