jersey icon indicating copy to clipboard operation
jersey copied to clipboard

How to disable JaxRSFeature.READ_FULL_STREAM?

Open hkawa608 opened this issue 1 year ago • 2 comments

Ref to https://github.com/eclipse-ee4j/jersey/commit/e79aa535afe6f2c9fb7b0a39e4d0cc02d198c99a#diff-2ef29e24080600307e208ebcf3399be243501ea767e94224d4923f1f95828eaeR489-R491

In Jesey 2.41, JaxRSFeature.READ_FULL_STREAM is set to true by default. Due to this change, we have an interoperability problem that we cannot fix or avoid. So we want to disable this feature by default. How can we disable this feature? I googled a lot, but I cannot find a solution... We don't register any sub ProviderBase classes manually to ResourceConfig.

Thank you.

hkawa608 avatar Jan 09 '24 11:01 hkawa608

Please understand that JaxRSFeature class is Jackson class, which Jersey merely repackages. The proper way of configuring Jackson should be on the Jackson documentation page.

However... The Jackson providers do contain enable() and disable() methods that are used to set the properties in JaxRSFeature. So you should be able for instance to register the instance of Jackson providers (JacksonJaxbJsonProvider, JacksonJsonProvider) that have the disable() method set in Jersey.

jansupol avatar Jan 14 '24 22:01 jansupol

@hkawa608

Have you tried:

.property(ClientProperties.REQUEST_ENTITY_PROCESSING, RequestEntityProcessing.CHUNKED)

rawleyfowler avatar Jan 23 '24 22:01 rawleyfowler