activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clebertsuco...@apache.org
Subject [1/3] activemq-artemis git commit: ARTEMIS-1444 Fixing byte buffer conversion
Date Mon, 09 Oct 2017 16:54:23 GMT
Repository: activemq-artemis
Updated Branches:
  refs/heads/master 88e1fdc78 -> 16aa7ed6c


ARTEMIS-1444 Fixing byte buffer conversion

I'm also using a lower size on message, to speed up the new test.

(100M may be a lot on some CIs)


Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/1d5fe286
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/1d5fe286
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/1d5fe286

Branch: refs/heads/master
Commit: 1d5fe2862a8baee8214640bf756ee171a5040c3d
Parents: 988c915
Author: Clebert Suconic <clebertsuconic@apache.org>
Authored: Mon Oct 9 12:49:48 2017 -0400
Committer: Clebert Suconic <clebertsuconic@apache.org>
Committed: Mon Oct 9 12:50:38 2017 -0400

----------------------------------------------------------------------
 .../activemq/artemis/core/server/impl/ServerSessionImpl.java    | 5 ++++-
 .../tests/integration/openwire/OpenWireLargeMessageTest.java    | 4 ++--
 2 files changed, 6 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/1d5fe286/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ServerSessionImpl.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ServerSessionImpl.java
b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ServerSessionImpl.java
index a2f4719..7813341 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ServerSessionImpl.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ServerSessionImpl.java
@@ -32,6 +32,7 @@ import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.atomic.AtomicLong;
 
 import org.apache.activemq.artemis.Closeable;
+import org.apache.activemq.artemis.api.core.ActiveMQBuffer;
 import org.apache.activemq.artemis.api.core.ActiveMQException;
 import org.apache.activemq.artemis.api.core.ActiveMQIOErrorException;
 import org.apache.activemq.artemis.api.core.ActiveMQIllegalStateException;
@@ -1315,7 +1316,9 @@ public class ServerSessionImpl implements ServerSession, FailureListener
{
       ICoreMessage coreMessage = message.toCore();
       LargeServerMessage lsm = getStorageManager().createLargeMessage(storageManager.generateID(),
coreMessage);
 
-      byte[] body = coreMessage.getReadOnlyBodyBuffer().toByteBuffer().array();
+      ActiveMQBuffer buffer = coreMessage.getReadOnlyBodyBuffer();
+      byte[] body = new byte[buffer.readableBytes()];
+      buffer.readBytes(body);
       lsm.addBytes(body);
       lsm.releaseResources();
       lsm.putLongProperty(Message.HDR_LARGE_BODY_SIZE, body.length);

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/1d5fe286/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/OpenWireLargeMessageTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/OpenWireLargeMessageTest.java
b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/OpenWireLargeMessageTest.java
index 1219d31..35cea1b 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/OpenWireLargeMessageTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/OpenWireLargeMessageTest.java
@@ -52,8 +52,8 @@ public class OpenWireLargeMessageTest extends BasicOpenWireTest {
          MessageProducer producer = session.createProducer(queue);
          producer.setDeliveryMode(DeliveryMode.PERSISTENT);
 
-         // Create 100Mb Message
-         int size = 1024 * 1024 * 10;
+         // Create 1MB Message
+         int size = 1024 * 1024;
          byte[] bytes = new byte[size];
          BytesMessage message = session.createBytesMessage();
          message.writeBytes(bytes);


Mime
View raw message