camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From _Jens <jens.riemschnei...@icw.de>
Subject Static buffer field in HTTPConduit
Date Tue, 04 Aug 2009 13:46:13 GMT

Hi,

I ran into a multi-threading problem with a web service that returned
multiple attachments. After playing around with this for some time I found
that data that is read from the PushbackInputStream often gets unread
shortly afterwards. When my problem occurred this did not happen, causing
the AttachmentDeserializer to "think" that there are fewer attachments.
After more diffing, I found this member in HTTPConduit:

    private static final byte BUFFER[] = new byte[1024];

This is only used in the HTTPConduit.close(). However, it is shared between
all instances of HTTPConduit and it seems to be possible that close() gets
called by multiple threads. I removed the 'static' from the field definition
and didn't see any problems anymore. I'm still not so sure about all the
details that occur and why this buffer causes problems with attachments.
Could someone confirm that this is a bug or could it be that my setup is
wrong?

Thanks,
Jens
-- 
View this message in context: http://www.nabble.com/Static-buffer-field-in-HTTPConduit-tp24808979p24808979.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Mime
View raw message