This repository was archived by the owner on Dec 7, 2018. It is now read-only.
[#45] Describe the three different Serializers in Advanced Tuning section#60
Merged
[#45] Describe the three different Serializers in Advanced Tuning section#60
Conversation
added 4 commits
July 11, 2018 15:23
Introduce Serializers topic in the Advanced Customizations section, giving a break down of the possible serializers, configurable levels and a code example #45
Refer to Serializer section and add messageSerializer Spring example #45
Be a bit more specific on serializer in the Saga section #45
Refer to Serializer section #45
abuijze
approved these changes
Jul 12, 2018
Member
abuijze
left a comment
There was a problem hiding this comment.
Committed some minor changes.
m1l4n54v1c
reviewed
Jul 13, 2018
Member
m1l4n54v1c
left a comment
There was a problem hiding this comment.
One minor grammar thing.
One suggestion.
| ``` | ||
|
|
||
| When overriding both the default serializer and defining an event serializer, we must instruct Spring that the default serializer is, well, the default: | ||
| Equal to events, you can also customize the Message `Serializer` used by your application. The Message `Serializer` comes into play when your Command and Query message are send from one node to another in a distributed environment. To set a custom `Serializer` for you message you can simply define a `messageSerializer` bean like so: |
Member
There was a problem hiding this comment.
... Query messages are sent from one ...
| 3. The Default `Serializer` is in charge of de-/serializing the remainder, being the Tokens, Snapshots and Sagas. These objects are generally not shared between different applications, and most of these classes aren't expected to have some of the getters and setters that are, for example, typically required by Jackson based serializers. A flexible, general purpose serializer like [XStream](http://x-stream.github.io/) is quite suited for this purpose. | ||
|
|
||
| By default all three `Serializer` flavors are set to use the `XStreamSerializer`, which internally uses [XStream](http://x-stream.github.io/) to serialize objects to an XML format. XML is a verbose format to serialize to, but XStream has the major benefit of being able to serialize virtually anything. This verbosity is typically fine when storing tokens, sagas or snapshots, but for messages (and specifically events) XML might prove to cost too much due to its serialized size. Thus for optimization reasons you can configure different serializers for your messages. | ||
|
|
Member
There was a problem hiding this comment.
Suggestion: I would mention interoperability reasons here also. If some other systems (not necessarily written in Java) wants to read the events, some other format is preferred here.
Member
Author
There was a problem hiding this comment.
Fair suggestion which is good to take into account. Will make the necessary adjustment.
Fix typo and add suggestion #45
m1l4n54v1c
approved these changes
Jul 17, 2018
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds a more concise description on what
Serializerimplementations there are and how these are configured correctly. Additionally, the section is referred to from several location to add clarity.Resolve #45