Core concepts
Choose the intent before the API.
Most applications can be designed around four operations: publish, send, consume, and request.
Publish
Announce that something happened. Every interested queue receives its own copy.
Use for:Domain events, notifications, integration events.
Send
Deliver work to a specific endpoint. One consumer instance handles the message.
Use for:Directed tasks and point-to-point operations.
Send to a queue
Resolve a send endpoint for a logical or RabbitMQ address, then send the command.
Consume
Each message delivery receives a context containing the message, headers, addresses, and helpers for follow-up operations. A successful asynchronous completion acknowledges the delivery; an exception enters retry and fault handling.
Request and response
Use a request client when the sender expects one typed response and needs correlated fault handling.
Envelope and context
MyServiceBus wraps each message in a portable envelope containing identifiers, addresses, message type URNs, headers, and host information. C# and Java use the same wire shape, while contexts expose that metadata idiomatically at runtime.
RabbitMQ routes messages that no consumer recognizes to a companion _skipped queue for inspection or reprocessing.