-
-
Notifications
You must be signed in to change notification settings - Fork 364
Serialization
Serialization with Rebus consists of transforming a Message
into a TransportMessageToSend
, and a ReceivedTransportMessage
back into a Message
.
Here, Message
is an object that contains a headers dictionary and multiple logical messages.
TransportMessageToSend
and ReceivedTransportMessage
are then the physical transport messages, and they contain only headers and a byte[]
.
As default, Rebus will JSON serialize messages using NewtonSoft JSON.NET.
The choice of serializer affects a number of things, expecially when an app needs to deserialize messages! How does it handle different versions of messages? When a field has been removed? When a field has been added? Etc.
This might be a reason why you will not be satisfied with the builtin JSON serializer, because it puts a limit on how much you can affect the serialization process. In this case, you might want to implement your own ISerializeMessages
, possibly using one of Rebus' existing serializers as inspiration, and then you're free to do whatever your serialization library will let you do.
If you want to explicitly state which kind of serialization you want, you do it the usual way:
Configure.With(...)
.Serialization(s => s.UseJsonSerializer())
//...
or
Configure.With(...)
.Serialization(s => s.UseBinarySerializer())
//...
which are currently the only forms of serialization that Rebus includes.
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