10

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 ?

Bravo
  • 8,589
  • 14
  • 48
  • 85
  • If you want to change default mapper you need to add this one into your .yml/.properties file. spring.http.converters.preferred-json-mapper=somethingelse and also you need to add proper dependency into your pom.xml I'm using default one and gson. i didn't try something else. – Habil Nov 05 '18 at 09:19
  • 1
    possible duplication with this one https://stackoverflow.com/questions/53155161/how-to-use-google-gson-instead-of-the-default-jackson-of-the-spring-in-swagger/53155230#53155230 – ksadjad Nov 06 '18 at 19:20
  • From the homepage, https://jsoniter.com/, JSONITER is stil ln not compatible with Jackson. Do take note that if you want to replace Jackson with JSONITER. – Ian Lim Dec 14 '18 at 07:49

1 Answers1

2

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.

scrutari
  • 1,378
  • 2
  • 17
  • 33