Now supporting arbitrary payload classes#7
Open
BernhardBln wants to merge 2 commits intopingles:masterfrom
Open
Now supporting arbitrary payload classes#7BernhardBln wants to merge 2 commits intopingles:masterfrom
BernhardBln wants to merge 2 commits intopingles:masterfrom
Conversation
* The default payload class is now a clojure map * You can pass any other type as well, but in that case, you will have to provide your own (de)serializer and the payload-class when invoking service-discovery. * Clojure maps are converted to Java Hashmaps to get nicer JSON output * This breaks compatibility with the previous version where String was accepted as payload
Author
|
PS: The only draw-back here is that in the serialised hash map, there is an entry "@Class":"java.util.HashMap", which might break java frameworks that expect certain fields there. Maybe that could be switched off by using a newer version of the fasterxml object mapper and configuring it ourselves (rather than using the JsonInstanceSerializer from Curator), but I'd rather do that in a separate step :) |
Author
|
I actually dropped the JsonInstanceSerializer in the latest commit, and replaced it by a self-written one using clojure.java.data and clojure.data.json, as the |
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
provide your own (de)serializer and the payload-class when invoking
service-discovery.
accepted as payload