In-process or RabbitMQ
Whether a Module's Integration Events and Snapshots stay inside one Host or cross to other Hosts through RabbitMQ.
What it decides
How Integration Events and Snapshots reach the Modules that subscribe to them. Inside one Host they go through the Host's Outbox to its own subscriptions. With PouryaKit.Messaging.Wolverine.RabbitMq, a Host also sends them to, and receives them from, other Hosts through a RabbitMQ broker.
When to choose each
| In-process | RabbitMQ | |
|---|---|---|
| Where the subscribing Module runs | In the same Host as the publisher | In another Host, such as one generated with pouryakit-service |
| What the Host composes | The Outbox of its message store | The same, and UsePouryaKitRabbitMq with a service name, the Host's queue |
| What a receiving Host declares | Nothing: its Modules publish what they subscribe to | Receive or ReceiveSnapshot for each wire name another Host publishes |
| Delivery | As Messaging guarantees it, with a Receipt per subscription | The same guarantees, kept across the broker: RabbitMQ between Hosts |
Keep Modules in one Host while they deploy together; reach for the broker when a Module must run, scale or fail in a process of its own.
Move a Module to its own Host
Generate the receiving Host
dotnet new pouryakit-service -n Acme.StockDeclare what it receives
The receiving Host declares each Integration Event and Snapshot another Host publishes, under the publishing Module's wire name: A Host that receives.
Give each Host its service name and broker
Both Hosts configure the broker, each under a service name of its own: The service name. Start the receiving Host first, so its queue exists before anything is published to it.
What the Kit guarantees
| Stated in | |
|---|---|
| Inside one Host | Messaging guarantees |
| Across the broker | What the Kit guarantees across the broker |