How to configure Gzip compression in cxf

Solution Unverified - Updated -

Issue

  • We are testing a service via SOAP UI which is hosted on JBoss Fuse.
    From SOAP UI, by default the header below is sent
    Accept-Encoding: gzip,deflate

We notice that when this header is sent, the Fuse ESB connection with the back-end service fails with the following error:

java.lang.RuntimeException: Couldn't parse stream.
    at org.apache.cxf.staxutils.StaxUtils.createXMLStreamReader(StaxUtils.java:1713)[118:org.apache.cxf.cxf-core:3.0.4.redhat-620133]
    at org.apache.cxf.interceptor.StaxInInterceptor.handleMessage(StaxInInterceptor.java:123)[118:org.apache.cxf.cxf-core:3.0.4.redhat-620133]
    at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:307)[118:org.apache.cxf.cxf-core:3.0.4.redhat-620133]
    at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:784)[118:org.apache.cxf.cxf-core:3.0.4.redhat-620133]
    at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:1644)[123:org.apache.cxf.cxf-rt-transports-http:3.0.4.redhat-620133]
    at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream$1.run(HTTPConduit.java:1155)[123:org.apache.cxf.cxf-rt-transports-http:3.0.4.redhat-620133]
    at org.apache.cxf.workqueue.AutomaticWorkQueueImpl$3.run(AutomaticWorkQueueImpl.java:428)[118:org.apache.cxf.cxf-core:3.0.4.redhat-620133]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)[:1.7.0_79]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)[:1.7.0_79]
    at org.apache.cxf.workqueue.AutomaticWorkQueueImpl$AWQThreadFactory$1.run(AutomaticWorkQueueImpl.java:353)[118:org.apache.cxf.cxf-core:3.0.4.redhat-620133]
    at java.lang.Thread.run(Thread.java:745)[:1.7.0_79]
Caused by: java.io.CharConversionException: Invalid UTF-8 start byte 0x8b (at char #2, byte #-1)

  • Is this happening because the header from the front end fuse client request (Accept-Encoding) is transferred to the cxf client inside fuse which connects to the back-end service provider?
  • What do we need to allow Fuse to accept this header from front end caller?

Environment

  • Red Hat JBoss Fuse
    • 6.x

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.