Replies: 1 comment
-
Hi @komdil If the consumer is handling messages and kicking off workflows (like calling services or use cases), it’s usually best to put it in the Application Layer. This layer is great for managing things like processing incoming events, doing any data transformations, and then passing things along to the domain layer to handle the actual business logic. So, it kind of acts like a controller, but for events or messages instead of HTTP requests. But, if the consumer is more about the technical side—like setting up message queues, managing connections, or other infrastructure stuff—then you’d probably place it in the Infrastructure Layer. Here, it handles the external system connections, and then it calls into the app layer when needed. Most of the time, you’d want the actual logic to live in the application, while the infrastructure just manages the mechanics of how things connect. |
Beta Was this translation helpful? Give feedback.
-
I am using RabbitMQ on my services and currently don't know in which layer might be best to put consumers
Beta Was this translation helpful? Give feedback.
All reactions