Provide Gson/JSON-B MessageConverter for spring-messaging (aligned with spring-web)
See original GitHub issueMarten Deinum opened SPR-16958 and commented
When using messaging there are MessageConverter
implementations using Jackson to marshall message from/to JSON. However there doesn’t seem to be one for GSON whereas there is GSON support in the web area.
Now when using both messaging and web and when using GSON and want to use JSON for marshaling you need both providers on the class path. It would be nice if we could use GSON in the messaging area as well.
Affects: 5.0.7
Referenced from: pull request https://github.com/spring-projects/spring-framework/pull/1863
Issue Analytics
- State:
- Created 5 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
Gson with Spring Boot | Java Development Journal
Spring provides a GsonHttpMessageConverter that can read and write JSON using ... #Preferred JSON mapper to use for HTTP message conversion.
Read more >GsonMessageConverter (Spring Framework 6.0.2 API)
Implementation of MessageConverter that can read and write JSON using Google Gson. Since: 5.3; Author: Juergen Hoeller; See Also: Gson; GsonBuilder; setGson ......
Read more >How config gson in Spring boot? - java - Stack Overflow
You need to register org.springframework.http.converter.json.GsonHttpMessageConverter converter which handles serialisation and ...
Read more >Http Message Converters with the Spring Framework - Baeldung
Simply put, we can use message converters to marshall and unmarshall Java Objects to and from JSON and XML over HTTP. Further reading:...
Read more >Configure gson in spring using GsonHttpMessageConverter
Screencast #23: Jackson has been the default json library in springframework until version 4.1 where it added support to use Gson by ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I’ve repurposed this issue for the Gson / JSON-B (Apache Johnzon) alignment in
spring-messaging
, with the primary target being WebSocket support. My local implementations are designed with a common base class, similar to the arrangement inspring-web
, and similarly included in our default WebSocket configuration based on classpath presence. To be committed ASAP.My view of it was the same as mentioned above, namely consistency across borders of web vs messaging and the auto-configurations. The proposed road ahead for aligning
spring-messaging
andspring-web
makes sense.