activemq-artemis git commit: ARTEMIS-2116 Set text message content on producer CLI command

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

activemq-artemis git commit: ARTEMIS-2116 Set text message content on producer CLI command

nigrofranz
Repository: activemq-artemis
Updated Branches:
  refs/heads/2.6.x 1cbeaf14b -> ec910388c


ARTEMIS-2116 Set text message content on producer CLI command

(cherry picked from commit d561ca34ff31b5336bebfaaee7cf415c5c785b28)


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

Branch: refs/heads/2.6.x
Commit: ec910388ccf8d8541fe49aab828591acc32379b3
Parents: 1cbeaf1
Author: Francesco Nigro <[hidden email]>
Authored: Tue Oct 9 18:04:00 2018 +0200
Committer: Francesco Nigro <[hidden email]>
Committed: Thu Oct 11 11:40:09 2018 +0200

----------------------------------------------------------------------
 .../activemq/artemis/cli/commands/messages/Producer.java      | 7 +++++--
 .../artemis/cli/commands/messages/ProducerThread.java         | 2 +-
 .../test/java/org/apache/activemq/cli/test/ArtemisTest.java   | 2 ++
 3 files changed, 8 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ec910388/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/messages/Producer.java
----------------------------------------------------------------------
diff --git a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/messages/Producer.java b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/messages/Producer.java
index 0936578..753cbaa 100644
--- a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/messages/Producer.java
+++ b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/messages/Producer.java
@@ -46,10 +46,13 @@ public class Producer extends DestAbstract {
    @Option(name = "--message-size", description = "Size of each byteMessage (The producer will use byte message on this case)")
    int messageSize = 0;
 
+   @Option(name = "--message", description = "Content of each textMessage (The producer will use text message on this case)")
+   String message = null;
+
    @Option(name = "--text-size", description = "Size of each textMessage (The producer will use text message on this case)")
    int textMessageSize;
 
-   @Option(name = "--object-size", description = "Size of each ObjectMessage (The producer will use object mesasge on this case)")
+   @Option(name = "--object-size", description = "Size of each ObjectMessage (The producer will use object message on this case)")
    int objectSize;
 
    @Option(name = "--msgttl", description = "TTL for each message")
@@ -121,7 +124,7 @@ public class Producer extends DestAbstract {
                threadsArray[i] = new ProducerThread(session, dest, i);
 
                threadsArray[i].setVerbose(verbose).setSleep(sleep).setPersistent(!nonpersistent).
-                  setMessageSize(messageSize).setTextMessageSize(textMessageSize).setObjectSize(objectSize).
+                  setMessageSize(messageSize).setTextMessageSize(textMessageSize).setMessage(message).setObjectSize(objectSize).
                   setMsgTTL(msgTTL).setMsgGroupID(msgGroupID).setTransactionBatchSize(txBatchSize).
                   setMessageCount(messageCount).setQueueId(queueId);
             }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ec910388/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/messages/ProducerThread.java
----------------------------------------------------------------------
diff --git a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/messages/ProducerThread.java b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/messages/ProducerThread.java
index 58a57ef..e3a4a23 100644
--- a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/messages/ProducerThread.java
+++ b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/messages/ProducerThread.java
@@ -53,7 +53,7 @@ public class ProducerThread extends Thread {
 
    int transactions = 0;
    final AtomicInteger sentCount = new AtomicInteger(0);
-   String message;
+   String message = null;
    String messageText = null;
    String payloadUrl = null;
    byte[] payload = null;

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ec910388/artemis-cli/src/test/java/org/apache/activemq/cli/test/ArtemisTest.java
----------------------------------------------------------------------
diff --git a/artemis-cli/src/test/java/org/apache/activemq/cli/test/ArtemisTest.java b/artemis-cli/src/test/java/org/apache/activemq/cli/test/ArtemisTest.java
index 526f7df..9045888 100644
--- a/artemis-cli/src/test/java/org/apache/activemq/cli/test/ArtemisTest.java
+++ b/artemis-cli/src/test/java/org/apache/activemq/cli/test/ArtemisTest.java
@@ -587,6 +587,8 @@ public class ArtemisTest extends CliTestBase {
          assertEquals(Integer.valueOf(10), Artemis.internalExecute("consumer", "--break-on-null", "--receive-timeout", "100", "--user", "admin", "--password", "admin"));
          assertEquals(Integer.valueOf(10), Artemis.internalExecute("producer", "--message-size", "500", "--message-count", "10", "--user", "admin", "--password", "admin"));
          assertEquals(Integer.valueOf(10), Artemis.internalExecute("consumer", "--break-on-null", "--receive-timeout", "100", "--user", "admin", "--password", "admin"));
+         assertEquals(Integer.valueOf(10), Artemis.internalExecute("producer", "--message", "message", "--message-count", "10", "--user", "admin", "--password", "admin"));
+         assertEquals(Integer.valueOf(10), Artemis.internalExecute("consumer", "--break-on-null", "--receive-timeout", "100", "--user", "admin", "--password", "admin"));
 
          ActiveMQConnectionFactory cf = new ActiveMQConnectionFactory("tcp://localhost:61616");
          Connection connection = cf.createConnection("admin", "admin");