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 ?
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 ).
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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With