-
-
Notifications
You must be signed in to change notification settings - Fork 364
Message dispatch
Since message dispatch is such an important part of Rebus, I think it's fair to dedicate a page to explain how it happens... here goes 🙂
Message dispatch is what happens when a Rebus endpoint receives a message - and message in this case is a transport message. A transport message is a serialized thing that has headers and a body.
The headers are simply string-based key-value pairs, and the body will by default be a UTF8-encoded JSON-serialized .NET object with full type information.
Upon receiving a transport message, Rebus will simply get its incoming pipeline and pass the message to it. After successful execution of the pipeline, the transaction context that spans the receive operation is completed.
All the interesting stuff happens inside the pipeline :)
By default, pipeline steps will be present that
- wraps the execution of the rest of the pipeline in an error-tracker
- deserializes the transport message
- looks up relevant message handlers
- loads/saves relevant saga data
- actually calls the message handler(s)
which does most of the work when handling an ordinary incoming message.
Depending on your configuration, other pipeline steps may be present - e.g. one that can filter and forward incoming messages, one that can save deferred messages for later, etc.
It can often be a good idea to log the contents of the pipelines to see the effect of the chosen configuration.
Basic stuff
- Home
- Introduction
- Getting started
- Different bus modes
- How does rebus compare to other .net service buses?
- 3rd party extensions
- Rebus versions
Configuration
Scenarios
Areas
- Logging
- Routing
- Serialization
- Pub sub messaging
- Process managers
- Message context
- Data bus
- Correlation ids
- Container adapters
- Automatic retries and error handling
- Message dispatch
- Thread safety and instance policies
- Timeouts
- Timeout manager
- Transactions
- Delivery guarantees
- Idempotence
- Unit of work
- Workers and parallelism
- Wire level format of messages
- Handler pipeline
- Polymorphic message dispatch
- Persistence ignorance
- Saga parallelism
- Transport message forwarding
- Testing
- Outbox
- Startup/shutdown
Transports (not a full list)
Customization
- Extensibility
- Auto flowing user context extensibility example
- Back off strategy
- Message compression and encryption
- Fail fast on certain exception types
Pipelines
- Log message pipelines
- Incoming messages pipeline
- Incoming step context
- Outgoing messages pipeline
- Outgoing step context
Prominent application services