-
-
Notifications
You must be signed in to change notification settings - Fork 361
Message context
Rebus' message context is available when you're inside a message handler. It's accessed via the MessageContext
class, e.g. like so
var currentContext = MessageContext.Current;
which is perfectly safe to do anywhere you want, it will just return null
when called outside of a message handler.
The message context is actually stored in the current ITransactionContext
, which is a logically thread-bound context class that spans the receive-and-handle operation ("logically" thread-bound because it follows the execution context on to the next thread when you await
something).
Rebus relies on the message context to do some of its things, e.g. it needs the message context to be able to reply to a message that is currently being handled.
You may also access the message context which gives you access to
- the transaction context
- the incoming step context
- the current transport message
- possibly the deserialized message
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