mirror of https://github.com/apache/activemq.git
applied patch for issue: http://www.nabble.com/Performance-problem-in-ActiveMQ4.2-SNAPSHOT-tf3973867s2354.html#a11280202
git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@550389 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
8842445fe4
commit
149fffda77
|
@ -74,10 +74,11 @@ public class ActiveMQTextMessage extends ActiveMQMessage implements TextMessage
|
|||
|
||||
public String getText() throws JMSException {
|
||||
if (text == null && getContent() != null) {
|
||||
InputStream is = null;
|
||||
try {
|
||||
ByteSequence bodyAsBytes = getContent();
|
||||
if (bodyAsBytes != null) {
|
||||
InputStream is = new ByteArrayInputStream(bodyAsBytes);
|
||||
is = new ByteArrayInputStream(bodyAsBytes);
|
||||
if( isCompressed() ) {
|
||||
is = new InflaterInputStream(is);
|
||||
}
|
||||
|
@ -89,6 +90,16 @@ public class ActiveMQTextMessage extends ActiveMQMessage implements TextMessage
|
|||
} catch (IOException ioe) {
|
||||
throw JMSExceptionSupport.create(ioe);
|
||||
}
|
||||
finally {
|
||||
if (is != null) {
|
||||
try {
|
||||
is.close();
|
||||
}
|
||||
catch (IOException e) {
|
||||
// ignore
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return text;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue