In a multi-service environment where do you declare the message broker?

So say I’ve got a system made up of 3 serverless service projects. They interact with each other using some sort of message broker (SQS, Kinesis etc). Which service defines the SQS queue or whatever (so that the cloudfront definition is generated)? Is there a convention for this? Should it be the service that primarily does the enqueue?

I guess it depends how you use the queues. For myself, every queue or SNS topic I create has only one publisher. Because you don’t pay for the actual queue or topic itself, only the messages sent, this means I can organise things a bit better.

That also means, choosing where to define the queue or topic just became easier as it will be the publishing service that then configures it, at least for me.

1 Like

That’s where my intuition was as well, glad I’m not way off base. Thanks

Because the whole Serverless paradigm/mode/architecture/design pattern, whatever you want to call it, is so new, there are a lot of these questions as there isn’t any concrete best practice yet. I’ve come up with a few based on my own experiences but they are very subjective and may not apply to everyone. All we can do is share and eventually a general consensus will be formulated.