camel-platform-http extension's response logic internally uses Files.readAllBytes() which causes OoME

Solution Verified - Updated -

Issue

In the camel route, File object is set in the in.body(). During the writeResponse() by camel-platform-http extension, OoME occurs.

"vert.x-eventloop-thread-1" prio=5 tid=26 RUNNABLE 120 B (0%) n/a
at java.lang.OutOfMemoryError.<init> (OutOfMemoryError.java:48)
at java.nio.file.Files.read (Files.java:3218)
at java.nio.file.Files.readAllBytes (Files.java:3275)
at org.apache.camel.converter.NIOConverter.toByteBuffer (NIOConverter.java:86)
at org.apache.camel.converter.NIOConverter.toByteBuffer (NIOConverter.java:74)
at org.apache.camel.converter.CamelBaseBulkConverterLoader.doConvertTo (CamelBaseBulkConverterLoader.java:407)
at org.apache.camel.converter.CamelBaseBulkConverterLoader.convertTo (CamelBaseBulkConverterLoader.java:56)
at org.apache.camel.spi.BulkTypeConverters.convertTo (BulkTypeConverters.java:122)
at org.apache.camel.impl.converter.CoreTypeConverterRegistry.tryCachedConverters (CoreTypeConverterRegistry.java:408)
at org.apache.camel.impl.converter.CoreTypeConverterRegistry.doConvertTo (CoreTypeConverterRegistry.java:375)
at org.apache.camel.impl.converter.CoreTypeConverterRegistry.doConvertToAndStat (CoreTypeConverterRegistry.java:269)
at org.apache.camel.impl.converter.CoreTypeConverterRegistry.tryConvertTo (CoreTypeConverterRegistry.java:252)
at org.apache.camel.component.platform.http.vertx.VertxPlatformHttpSupport.writeResponseAsFallback (VertxPlatformHttpSupport.java:207)
at org.apache.camel.component.platform.http.vertx.VertxPlatformHttpSupport.writeResponse (VertxPlatformHttpSupport.java:194)

Environment

  • Red Hat Build of Apache Camel for Quarkus
    • 3.15.x
    • 3.20

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content