diff options
author | scottkurz <scottkurz@13f79535-47bb-0310-9956-ffa450edef68> | 2009-05-19 21:10:45 +0000 |
---|---|---|
committer | scottkurz <scottkurz@13f79535-47bb-0310-9956-ffa450edef68> | 2009-05-19 21:10:45 +0000 |
commit | 7d055e7c9f52ed1d4782e4dcc9c8392f2b2617ea (patch) | |
tree | af945d1ceab15aedfec1a14963dcab1372d0e1fb /branches/sca-java-1.x/modules/binding-jms-runtime/src | |
parent | 0e0aa3e9b9596964ce91058fe8c06dee7d95032e (diff) |
Do BytesMessage.reset() on BytesMP, DefaultMP to be consistent across wire formats.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@776461 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'branches/sca-java-1.x/modules/binding-jms-runtime/src')
2 files changed, 3 insertions, 1 deletions
diff --git a/branches/sca-java-1.x/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/BytesMessageProcessor.java b/branches/sca-java-1.x/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/BytesMessageProcessor.java index b2f5102bb7..6ffbabd2b0 100644 --- a/branches/sca-java-1.x/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/BytesMessageProcessor.java +++ b/branches/sca-java-1.x/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/BytesMessageProcessor.java @@ -71,6 +71,7 @@ public class BytesMessageProcessor extends AbstractMessageProcessor { long noOfBytes = ((BytesMessage)msg).getBodyLength(); byte [] bytes = new byte[(int)noOfBytes]; ((BytesMessage)msg).readBytes(bytes); + ((BytesMessage)msg).reset(); return bytes; } catch (JMSException e) { diff --git a/branches/sca-java-1.x/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/DefaultMessageProcessor.java b/branches/sca-java-1.x/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/DefaultMessageProcessor.java index 848986f8b1..05f264db78 100644 --- a/branches/sca-java-1.x/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/DefaultMessageProcessor.java +++ b/branches/sca-java-1.x/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/DefaultMessageProcessor.java @@ -186,7 +186,8 @@ public class DefaultMessageProcessor extends AbstractMessageProcessor { long noOfBytes = ((BytesMessage) msg).getBodyLength(); byte[] bytes = new byte[(int) noOfBytes]; ((BytesMessage) msg).readBytes(bytes); - + ((BytesMessage)msg).reset(); + if ((bytes != null) && (bytes.length > 0)) { XMLStreamReader reader = XMLInputFactory.newInstance().createXMLStreamReader(new ByteArrayInputStream(bytes)); StAXOMBuilder builder = new StAXOMBuilder(reader); |