-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #38196 from mariofusco/jackson_vertx_pool
Use Vert.x pool with Jackson
- Loading branch information
Showing
3 changed files
with
26 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
...ntime/src/main/java/io/quarkus/jackson/runtime/VertxHybridPoolObjectMapperCustomizer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package io.quarkus.jackson.runtime; | ||
|
||
import com.fasterxml.jackson.core.util.JsonRecyclerPools; | ||
import com.fasterxml.jackson.databind.ObjectMapper; | ||
|
||
import io.quarkus.jackson.ObjectMapperCustomizer; | ||
import io.vertx.core.json.jackson.HybridJacksonPool; | ||
|
||
public class VertxHybridPoolObjectMapperCustomizer implements ObjectMapperCustomizer { | ||
|
||
@Override | ||
public void customize(ObjectMapper objectMapper) { | ||
if (objectMapper.getFactory()._getRecyclerPool() == JsonRecyclerPools.defaultPool()) { | ||
objectMapper.getFactory().setRecyclerPool(HybridJacksonPool.getInstance()); | ||
} | ||
} | ||
} |