Comments (9)
@MythosRaconteur No can of worms - discussion is always good. 🙂
from propono.
Hey @MythosRaconteur - thanks for posting. Let me have a think about this over the weekend and try and work something out. Thanks.
from propono.
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
from propono.
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
from propono.
@malcyL Yeah - I like that idea. My only concern is if subject
already has meaning for someone in the payload. Are there rules around what the SNS topic subject can be? If so, the two might clash causing a breaking change (e.g. if SNS-topic-subject has to be ascii and someone is using unicode in their payload).
We could do both, so you can specify subject
on publish. If you don't then it uses the subject
from the payload. If you want to stop that later behaviour, you could set subject
to nil
. We could also make it a config option in general?
Thoughts?
from propono.
@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.
from propono.
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?
from propono.
Hello. v2 is now released and I'm in Propono mindset. Do I need to do anything here? :)
from propono.
from propono.
Related Issues (20)
- Travis CI Build Failures Due to Bundler Version HOT 1
- wrong number of arguments (given 5, expected 4) HOT 3
- Asynchronous listen_to_queue HOT 2
- License info on gh-pages branch inconsistent with LICENSE.md HOT 1
- Use IAM role instead of access & secret keys HOT 3
- Way to use FIFO queues? HOT 5
- Should we merge iterum into Propono HOT 2
- Message Visibility Timeout is too short for some classes of tasks HOT 3
- Docs - Note about needing a subscriber before you publish
- Docs - Flowchart of corrupted/failed/etc queue logic
- Docs - Description/diagram of single-queue-multiple-listener vs fanout
- How do I use GoAWS? HOT 3
- Update repository HOT 1
- Javascript subscriber HOT 7
- ArgumentError: invalid configuration option `:use_iam_profile' HOT 2
- Queue size and oldest message? HOT 1
- Multiple listen blocks on the same file HOT 7
- Slow queue wait implementation causes delay in processing of new main queue messages HOT 2
- messages being processed multiple times by same worker name HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from propono.