PouryaKit
Decision guides

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.

A Host's choice, not a Module's

Modules, Contracts and Feature code never reference the RabbitMQ package, and nothing in them changes when a Host adds it. The same Inventory Module runs in the modular monolith and, unchanged, in a Host of its own.

When to choose each

In-processRabbitMQ
Where the subscribing Module runsIn the same Host as the publisherIn another Host, such as one generated with pouryakit-service
What the Host composesThe Outbox of its message storeThe same, and UsePouryaKitRabbitMq with a service name, the Host's queue
What a receiving Host declaresNothing: its Modules publish what they subscribe toReceive or ReceiveSnapshot for each wire name another Host publishes
DeliveryAs Messaging guarantees it, with a Receipt per subscriptionThe 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

Terminal
dotnet new pouryakit-service -n Acme.Stock

Declare 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 HostMessaging guarantees
Across the brokerWhat the Kit guarantees across the broker

Failure messages

Next steps

On this page