Author: gaohoward
Date: 2010-11-17 01:16:48 -0500 (Wed, 17 Nov 2010)
New Revision: 9906
Modified:
branches/Branch_Large_Message_Compression/src/main/org/hornetq/core/client/impl/LargeMessageBufferImpl.java
branches/Branch_Large_Message_Compression/src/main/org/hornetq/utils/GZipUtil.java
branches/Branch_Large_Message_Compression/tests/src/org/hornetq/tests/integration/client/LargeMessageCompressTest.java
Log:
fix closing output stream after stream end issue
Modified:
branches/Branch_Large_Message_Compression/src/main/org/hornetq/core/client/impl/LargeMessageBufferImpl.java
===================================================================
---
branches/Branch_Large_Message_Compression/src/main/org/hornetq/core/client/impl/LargeMessageBufferImpl.java 2010-11-17
05:07:27 UTC (rev 9905)
+++
branches/Branch_Large_Message_Compression/src/main/org/hornetq/core/client/impl/LargeMessageBufferImpl.java 2010-11-17
06:16:48 UTC (rev 9906)
@@ -287,7 +287,6 @@
*/
public synchronized boolean waitCompletion(final long timeWait) throws
HornetQException
{
-
if (outStream == null)
{
// There is no stream.. it will never achieve the end of streaming
@@ -1258,11 +1257,12 @@
{
try
{
+ output.write(packet.getBody());
if (!packet.isContinues())
{
streamEnded = true;
+ output.close();
}
- output.write(packet.getBody());
}
catch (IOException e)
{
Modified:
branches/Branch_Large_Message_Compression/src/main/org/hornetq/utils/GZipUtil.java
===================================================================
---
branches/Branch_Large_Message_Compression/src/main/org/hornetq/utils/GZipUtil.java 2010-11-17
05:07:27 UTC (rev 9905)
+++
branches/Branch_Large_Message_Compression/src/main/org/hornetq/utils/GZipUtil.java 2010-11-17
06:16:48 UTC (rev 9906)
@@ -232,7 +232,6 @@
b = zipIn.read();
}
target.close();
- System.err.println(" total write: " + counter);
}
}
Modified:
branches/Branch_Large_Message_Compression/tests/src/org/hornetq/tests/integration/client/LargeMessageCompressTest.java
===================================================================
---
branches/Branch_Large_Message_Compression/tests/src/org/hornetq/tests/integration/client/LargeMessageCompressTest.java 2010-11-17
05:07:27 UTC (rev 9905)
+++
branches/Branch_Large_Message_Compression/tests/src/org/hornetq/tests/integration/client/LargeMessageCompressTest.java 2010-11-17
06:16:48 UTC (rev 9906)
@@ -2707,15 +2707,10 @@
File testFile = new File(testDir, "async_large_message");
FileOutputStream output = new FileOutputStream(testFile);
- System.out.println("set out");
-
msg1.setOutputStream(output);
+
+ msg1.waitOutputStreamCompletion(0);
- System.out.println("waiting...");
- msg1.waitOutputStreamCompletion(0);
-
- System.out.println("close output");
-
msg1.acknowledge();
session.commit();