Skip to content

Commit

Permalink
Use a virtual threads friendly pool with Jackson
Browse files Browse the repository at this point in the history
  • Loading branch information
mariofusco committed Sep 8, 2023
1 parent 339020d commit e203777
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion bom/application/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
<plexus-component-annotations.version>2.1.0</plexus-component-annotations.version>
<graal-sdk.version>23.0.1</graal-sdk.version>
<gizmo.version>1.6.1.Final</gizmo.version>
<jackson-bom.version>2.15.2</jackson-bom.version>
<jackson-bom.version>2.16.0-SNAPSHOT</jackson-bom.version>
<commons-logging-jboss-logging.version>1.0.0.Final</commons-logging-jboss-logging.version>
<commons-lang3.version>3.12.0</commons-lang3.version>
<commons-codec.version>1.16.0</commons-codec.version>
Expand Down
2 changes: 2 additions & 0 deletions extensions/jackson/runtime/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,12 @@
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-jdk8</artifactId>
<version>2.15.2</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.module</groupId>
<artifactId>jackson-module-parameter-names</artifactId>
<version>2.15.2</version>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import jakarta.inject.Singleton;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.core.util.BufferRecyclerPool;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.MapperFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
Expand Down Expand Up @@ -63,6 +64,9 @@ public ObjectMapper objectMapper(@All List<ObjectMapperCustomizer> customizers,
for (ObjectMapperCustomizer customizer : sortedCustomizers) {
customizer.customize(objectMapper);
}
if (true) {
objectMapper.getFactory().setBufferRecyclerPool(BufferRecyclerPool.LockFreePool.shared());
}
return objectMapper;
}

Expand Down

0 comments on commit e203777

Please sign in to comment.