We are currently using LoggingInInterceptor/LoggingOutInterceptor to log soap
messages in our application however these interceptors takes a significant
amount of time especially on the IOUtils.copy(is, bos)  call. Is their any
way to call this part of the code in a separate thread without having the
InputStream closed on us or Are there any other alternatives to improve
performance here?


InputStream is = message.getContent(InputStream.class);
        if (is != null) {
            CachedOutputStream bos = new CachedOutputStream();
            try {
                IOUtils.copy(is, bos);

                bos.flush();
                is.close();

                message.setContent(InputStream.class, bos.getInputStream());
                if (bos.getTempFile() != null) {
                    //large thing on disk...
                    buffer.getMessage().append("\nMessage (saved to tmp
file):\n");
                    buffer.getMessage().append("Filename: " +
bos.getTempFile().getAbsolutePath() + "\n");
                }
                if (bos.size() > limit) {
                    buffer.getMessage().append("(message truncated to " +
limit + " bytes)\n");
                }
                writePayload(buffer.getPayload(), bos, encoding, ct); 
                    
                bos.close();
            } catch (Exception e) {
                throw new Fault(e);
            }
        }
        log(buffer.toString());




--
View this message in context: 
http://cxf.547215.n5.nabble.com/LoggingInInterceptor-consuming-time-for-big-messages-tp5766419.html
Sent from the cxf-user mailing list archive at Nabble.com.

Reply via email to