question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Provide Gson/JSON-B MessageConverter for spring-messaging (aligned with spring-web)

See original GitHub issue

Marten 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:closed
  • Created 5 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
jhoellercommented, Sep 24, 2020

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 in spring-web, and similarly included in our default WebSocket configuration based on classpath presence. To be committed ASAP.

0reactions
gaxpaycommented, Sep 17, 2020

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 and spring-web makes sense.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found