You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Emil Dombagolla <do...@gmail.com> on 2011/03/21 06:38:03 UTC

GZIP interceptor

Dear Everyone,


I have CFX client program. My CFX.xml files as follows for your reference,


I added logging interceptors and it works fine. Entire message printed on my
console. And then I added the GZIP interceptor, now the problem is
message-content of the log printed in compressed format.


I want my program use the GZIP and log should be printed as normal readable
text.


Is it possible get it worked as this, can I change the interceptor order and
fix this?

Please help me with any kind of suggestion,

Thank you so much.

Emil




------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


<bean id="logInbound"
class="org.apache.cxf.interceptor.LoggingInInterceptor"/>

    <bean id="logOutbound"
class="org.apache.cxf.interceptor.LoggingOutInterceptor"/>

    <bean id="compressGZIPFeature"
class="org.apache.cxf.transport.http.gzip.GZIPFeature"/>

 <cxf:bus>

    <cxf:features>

            <ref bean="compressGZIPFeature"/>

        </cxf:features>

        <cxf:inInterceptors>

            <ref bean="logInbound"/>

        </cxf:inInterceptors>

        <cxf:outInterceptors>

            <ref bean="logOutbound"/>

        </cxf:outInterceptors>

        <cxf:outFaultInterceptors>

            <ref bean="logOutbound"/>

        </cxf:outFaultInterceptors>

        <cxf:inFaultInterceptors>

            <ref bean="logInbound"/>

        </cxf:inFaultInterceptors>

    </cxf:bus>

Re: GZIP interceptor

Posted by Aki Yoshida <el...@googlemail.com>.
Hi,
I don't think there is an out-of-the box way to gunzip the logging
output automatically. I also do not think it makes sense to introduce
an option to do this unziping in LoggingInterceptor.

What probably makes sense and what I think can be useful might be to
introduce an option to log the data in base64 so that if some binary
data is written into the text log, it can be reliably reconstructed
from the logged base64 text.

Regards, AKI



2011/3/21 Emil Dombagolla <do...@gmail.com>:
> Dear Everyone,
>
>
> I have CFX client program. My CFX.xml files as follows for your reference,
>
>
> I added logging interceptors and it works fine. Entire message printed on my
> console. And then I added the GZIP interceptor, now the problem is
> message-content of the log printed in compressed format.
>
>
> I want my program use the GZIP and log should be printed as normal readable
> text.
>
>
> Is it possible get it worked as this, can I change the interceptor order and
> fix this?
>
> Please help me with any kind of suggestion,
>
> Thank you so much.
>
> Emil
>
>
>
>
> ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>
> <bean id="logInbound"
> class="org.apache.cxf.interceptor.LoggingInInterceptor"/>
>
>    <bean id="logOutbound"
> class="org.apache.cxf.interceptor.LoggingOutInterceptor"/>
>
>    <bean id="compressGZIPFeature"
> class="org.apache.cxf.transport.http.gzip.GZIPFeature"/>
>
>  <cxf:bus>
>
>    <cxf:features>
>
>            <ref bean="compressGZIPFeature"/>
>
>        </cxf:features>
>
>        <cxf:inInterceptors>
>
>            <ref bean="logInbound"/>
>
>        </cxf:inInterceptors>
>
>        <cxf:outInterceptors>
>
>            <ref bean="logOutbound"/>
>
>        </cxf:outInterceptors>
>
>        <cxf:outFaultInterceptors>
>
>            <ref bean="logOutbound"/>
>
>        </cxf:outFaultInterceptors>
>
>        <cxf:inFaultInterceptors>
>
>            <ref bean="logInbound"/>
>
>        </cxf:inFaultInterceptors>
>
>    </cxf:bus>
>

Re: GZIP interceptor

Posted by Daniel Kulp <dk...@apache.org>.
This definitely would be an interceptor ordering issue.   Both the logging and 
gzip interceptors run  in the same phase so the output would depend on the 
order.     My suggestion would be to use the Logging feature and then play 
with the order of the features:


org.apache.cxf.feature.LoggingFeature
<bean id="compressGZIPFeature"
    class="org.apache.cxf.transport.http.gzip.GZIPFeature"/>
<bean id="loggingFeature"
    class="org.apache.cxf.feature.LoggingFeature"/>
<cxf:bus>
     <cxf:features>
             <ref bean="compressGZIPFeature"/>
             <ref bean="loggingFeature"/>
     </cxf:features>
</cxf:features>

That may put the logging stuff second so the gzip would occur first.   

Dan




On Monday 21 March 2011 1:38:03 AM Emil Dombagolla wrote:
> Dear Everyone,
> 
> 
> I have CFX client program. My CFX.xml files as follows for your reference,
> 
> 
> I added logging interceptors and it works fine. Entire message printed on
> my console. And then I added the GZIP interceptor, now the problem is
> message-content of the log printed in compressed format.
> 
> 
> I want my program use the GZIP and log should be printed as normal readable
> text.
> 
> 
> Is it possible get it worked as this, can I change the interceptor order
> and fix this?
> 
> Please help me with any kind of suggestion,
> 
> Thank you so much.
> 
> Emil
> 
> 
> 
> 
> ---------------------------------------------------------------------------
> ---------------------------------------------------------------------------
> ------------------------
> 
> 
> <bean id="logInbound"
> class="org.apache.cxf.interceptor.LoggingInInterceptor"/>
> 
>     <bean id="logOutbound"
> class="org.apache.cxf.interceptor.LoggingOutInterceptor"/>
> 
>     <bean id="compressGZIPFeature"
> class="org.apache.cxf.transport.http.gzip.GZIPFeature"/>
> 
>  <cxf:bus>
> 
>     <cxf:features>
> 
>             <ref bean="compressGZIPFeature"/>
> 
>         </cxf:features>
> 
>         <cxf:inInterceptors>
> 
>             <ref bean="logInbound"/>
> 
>         </cxf:inInterceptors>
> 
>         <cxf:outInterceptors>
> 
>             <ref bean="logOutbound"/>
> 
>         </cxf:outInterceptors>
> 
>         <cxf:outFaultInterceptors>
> 
>             <ref bean="logOutbound"/>
> 
>         </cxf:outFaultInterceptors>
> 
>         <cxf:inFaultInterceptors>
> 
>             <ref bean="logInbound"/>
> 
>         </cxf:inFaultInterceptors>
> 
>     </cxf:bus>

-- 
Daniel Kulp
dkulp@apache.org
http://dankulp.com/blog
Talend - http://www.talend.com