You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ta...@apache.org on 2014/01/29 18:28:59 UTC

git commit: Couple of changes to allow for some performance analysis.

Updated Branches:
  refs/heads/trunk cce75e092 -> 8b993b4dc


Couple of changes to allow for some performance analysis. 

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

Branch: refs/heads/trunk
Commit: 8b993b4dc6de85199f2ac19b178275180859ed15
Parents: cce75e0
Author: Timothy Bish <ta...@gmai.com>
Authored: Wed Jan 29 12:28:55 2014 -0500
Committer: Timothy Bish <ta...@gmai.com>
Committed: Wed Jan 29 12:28:55 2014 -0500

----------------------------------------------------------------------
 .../transport/amqp/bugs/AMQ4914Test.java         | 19 +++++++++++--------
 .../src/test/resources/log4j.properties          |  4 ++--
 2 files changed, 13 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq/blob/8b993b4d/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/bugs/AMQ4914Test.java
----------------------------------------------------------------------
diff --git a/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/bugs/AMQ4914Test.java b/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/bugs/AMQ4914Test.java
index aefae8b..b6fb1ea 100644
--- a/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/bugs/AMQ4914Test.java
+++ b/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/bugs/AMQ4914Test.java
@@ -32,7 +32,6 @@ import javax.jms.TextMessage;
 import org.apache.activemq.transport.amqp.AmqpTestSupport;
 import org.apache.qpid.amqp_1_0.jms.impl.ConnectionFactoryImpl;
 import org.apache.qpid.amqp_1_0.jms.impl.QueueImpl;
-import org.junit.Ignore;
 import org.junit.Rule;
 import org.junit.Test;
 import org.junit.rules.TestName;
@@ -76,12 +75,9 @@ public class AMQ4914Test extends AmqpTestSupport {
         doTestSendLargeMessage(65536 * 4);
     }
 
-    @Ignore("AMQ-4914")
     @Test(timeout = 2 * 60 * 1000)
-    public void testSendLargeMessages() throws JMSException {
-        //for (int i = 32000; i < (32 *1024); i++) {
-            doTestSendLargeMessage(32604);       // Fails at 32614; or 32604 with my changes to AmqpProtocolBuffer
-        //}
+    public void testSendHugeMessage() throws JMSException {
+        doTestSendLargeMessage(1024 * 1024 * 10);
     }
 
     public void doTestSendLargeMessage(int expectedSize) throws JMSException{
@@ -91,21 +87,27 @@ public class AMQ4914Test extends AmqpTestSupport {
 
         Connection connection = createAMQPConnection(port, false);
 
+        long startTime = System.currentTimeMillis();
         Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
         QueueImpl queue = new QueueImpl(QUEUE_NAME);
         MessageProducer producer = session.createProducer(queue);
         TextMessage message = session.createTextMessage();
         message.setText(payload);
         producer.send(message);
-        LOG.debug("Returned from send");
+        long endTime = System.currentTimeMillis();
+        LOG.info("Returned from send after {} ms", endTime - startTime);
 
+        startTime = System.currentTimeMillis();
         MessageConsumer consumer = session.createConsumer(queue);
         connection.start();
-        LOG.debug("Calling receive");
+        LOG.info("Calling receive");
         Message receivedMessage = consumer.receive();
         assertNotNull(receivedMessage);
         assertTrue(receivedMessage instanceof TextMessage);
         TextMessage receivedTextMessage = (TextMessage) receivedMessage;
+        assertNotNull(receivedMessage);
+        endTime = System.currentTimeMillis();
+        LOG.info("Returned from receive after {} ms", endTime - startTime);
         String receivedText = receivedTextMessage.getText();
         assertEquals(expectedSize, receivedText.getBytes().length);
         assertEquals(payload, receivedText);
@@ -115,6 +117,7 @@ public class AMQ4914Test extends AmqpTestSupport {
     private Connection createAMQPConnection(int testPort, boolean useSSL) throws JMSException {
         LOG.debug("In createConnection using port {} ssl? {}", testPort, useSSL);
         final ConnectionFactoryImpl connectionFactory = new ConnectionFactoryImpl("localhost", testPort, "admin", "password", null, useSSL);
+        connectionFactory.setSyncPublish(true);
         final Connection connection = connectionFactory.createConnection();
         connection.setExceptionListener(new ExceptionListener() {
             @Override

http://git-wip-us.apache.org/repos/asf/activemq/blob/8b993b4d/activemq-amqp/src/test/resources/log4j.properties
----------------------------------------------------------------------
diff --git a/activemq-amqp/src/test/resources/log4j.properties b/activemq-amqp/src/test/resources/log4j.properties
index 41aa7cd..106fd99 100755
--- a/activemq-amqp/src/test/resources/log4j.properties
+++ b/activemq-amqp/src/test/resources/log4j.properties
@@ -20,14 +20,14 @@
 #
 log4j.rootLogger=WARN, console, file
 log4j.logger.org.apache.activemq=INFO
-log4j.logger.org.apache.activemq.transport.amqp=INFO
+log4j.logger.org.apache.activemq.transport.amqp=TRACE
 log4j.logger.org.apache.activemq.transport.amqp.FRAMES=TRACE
 log4j.logger.org.fusesource=INFO
 
 # Console will only display warnnings
 log4j.appender.console=org.apache.log4j.ConsoleAppender
 log4j.appender.console.layout=org.apache.log4j.PatternLayout
-log4j.appender.console.layout.ConversionPattern=%-5p | %t | %m%n
+log4j.appender.console.layout.ConversionPattern=%d | %-5p | %t | %m%n
 log4j.appender.console.threshold=TRACE
 
 # File appender will contain all info messages