You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@pekko.apache.org by "He-Pin (via GitHub)" <gi...@apache.org> on 2024/03/27 17:25:33 UTC

Re: [PR] support jackson buffer recycler [pekko-http]

He-Pin commented on code in PR #519:
URL: https://github.com/apache/pekko-http/pull/519#discussion_r1541541664


##########
http-marshallers-java/http-jackson/src/main/java/org/apache/pekko/http/javadsl/marshallers/jackson/Jackson.java:
##########
@@ -113,7 +116,28 @@ static ObjectMapper createMapper(final Config config) {
         JsonFactory.builder()
             .streamReadConstraints(streamReadConstraints)
             .streamWriteConstraints(streamWriteConstraints)
+            .recyclerPool(getBufferRecyclerPool(config))
             .build();
     return new JsonMapper(jsonFactory);
   }
+
+  private static RecyclerPool<BufferRecycler> getBufferRecyclerPool(final Config cfg) {
+    switch (cfg.getString("buffer-recycler.pool-instance")) {

Review Comment:
   As it's been used in the exceptions, how about extract to a local val?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org