Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to replace jackson in spring boot application as automatic marshaler and unmarshaler with jsoniter

I am using jackson , which come along with spring boot , to convert from json to java object and vice versa , but i found that this is taking much time when json is huge in size like for 2 MB json to related java object by marshaling , can we use JSONITER , does it perform well ? how to replace JACKSON with JSONITER in spring boot , can any at present using this in your spring boot applications ?

like image 372
Bravo Avatar asked Sep 27 '17 09:09

Bravo


People also ask

Is Jackson Databind included in spring boot?

If you use Spring Boot, the jackson-databind dependency comes in the spring-boot-starter-json module (which also is included in other spring boot started moduled, like spring-boot-starter-web ).

Does spring use Jackson or GSON?

Spring Boot uses Jackson by default as the serialization/deserialization framework for Json. But for me, I prefer Google's Gson, which is much more concise. This article will teach you how to use Gson instead of Jackson in your Spring Boot application.

What is the use of ObjectMapper in spring boot?

Overview. When using JSON format, Spring Boot will use an ObjectMapper instance to serialize responses and deserialize requests. In this tutorial, we'll take a look at the most common ways to configure the serialization and deserialization options. To learn more about Jackson, be sure to check out our Jackson tutorial.


1 Answers

Spring Boot has many things listed in .yml / .properties files, but what is actually used in runtime is determined by which classes are found on classpath. So, assuming you are using Maven or Gradle, to replace one provider for json capability with another just specify explicitly dependency for what you need and exclude transitive dependency for Jackson that is brought by one of spring-boot-* ones.

like image 113
scrutari Avatar answered Sep 25 '22 01:09

scrutari