Skip to content

Commit

Permalink
This is PR #116
Browse files Browse the repository at this point in the history
  • Loading branch information
clebertsuconic committed Oct 12, 2018
2 parents 9d2da1c + bcf8169 commit 4e7f5d9
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -121,7 +124,7 @@ public Object execute(ActionContext context) throws Exception {
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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -587,6 +587,8 @@ public void testSimpleRun(String folderName) throws Exception {
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");
Expand Down

0 comments on commit 4e7f5d9

Please sign in to comment.