diff options
Diffstat (limited to 'qpid/java/perftests/src/main')
| -rw-r--r-- | qpid/java/perftests/src/main/java/org/apache/qpid/ping/PingSendOnlyClient.java | 18 | ||||
| -rw-r--r-- | qpid/java/perftests/src/main/java/org/apache/qpid/requestreply/PingPongProducer.java | 4 |
2 files changed, 19 insertions, 3 deletions
diff --git a/qpid/java/perftests/src/main/java/org/apache/qpid/ping/PingSendOnlyClient.java b/qpid/java/perftests/src/main/java/org/apache/qpid/ping/PingSendOnlyClient.java index 7cf5e4516f..29757a20ba 100644 --- a/qpid/java/perftests/src/main/java/org/apache/qpid/ping/PingSendOnlyClient.java +++ b/qpid/java/perftests/src/main/java/org/apache/qpid/ping/PingSendOnlyClient.java @@ -6,6 +6,12 @@ import java.util.Properties; import org.apache.log4j.Logger;
import org.apache.qpid.util.CommandLineParser;
+import org.apache.qpid.client.message.TestMessageFactory;
+
+import javax.jms.ObjectMessage;
+import javax.jms.Destination;
+import javax.jms.JMSException;
+import javax.jms.Message;
/**
* <p><table id="crc"><caption>CRC Card</caption>
@@ -32,7 +38,7 @@ public class PingSendOnlyClient extends PingDurableClient {
// Create a ping producer overriding its defaults with all options passed on the command line.
Properties options = CommandLineParser.processCommandLine(args, new CommandLineParser(new String[][] {}));
- PingDurableClient pingProducer = new PingSendOnlyClient(options);
+ PingSendOnlyClient pingProducer = new PingSendOnlyClient(options);
// Create a shutdown hook to terminate the ping-pong producer.
Runtime.getRuntime().addShutdownHook(pingProducer.getShutdownHook());
@@ -54,4 +60,14 @@ public class PingSendOnlyClient extends PingDurableClient System.exit(1);
}
}
+
+ public Message getTestMessage(Destination replyQueue, int messageSize, boolean persistent) throws JMSException
+ {
+ Message msg = TestMessageFactory.newTextMessage(_producerSession, messageSize);
+
+ // Timestamp the message in nanoseconds.
+ msg.setLongProperty(MESSAGE_TIMESTAMP_PROPNAME, System.nanoTime());
+
+ return msg;
+ }
}
diff --git a/qpid/java/perftests/src/main/java/org/apache/qpid/requestreply/PingPongProducer.java b/qpid/java/perftests/src/main/java/org/apache/qpid/requestreply/PingPongProducer.java index ecaf27167f..5dec2125ee 100644 --- a/qpid/java/perftests/src/main/java/org/apache/qpid/requestreply/PingPongProducer.java +++ b/qpid/java/perftests/src/main/java/org/apache/qpid/requestreply/PingPongProducer.java @@ -1049,7 +1049,7 @@ public class PingPongProducer implements Runnable, MessageListener, ExceptionLis try
{
// Generate a sample message and time stamp it.
- ObjectMessage msg = getTestMessage(_replyDestination, _messageSize, _persistent);
+ Message msg = getTestMessage(_replyDestination, _messageSize, _persistent);
msg.setLongProperty(MESSAGE_TIMESTAMP_PROPNAME, System.nanoTime());
// Send the message and wait for a reply.
@@ -1096,7 +1096,7 @@ public class PingPongProducer implements Runnable, MessageListener, ExceptionLis *
* @throws javax.jms.JMSException All underlying JMSException are allowed to fall through.
*/
- public ObjectMessage getTestMessage(Destination replyQueue, int messageSize, boolean persistent) throws JMSException
+ public Message getTestMessage(Destination replyQueue, int messageSize, boolean persistent) throws JMSException
{
ObjectMessage msg = TestMessageFactory.newObjectMessage(_producerSession, replyQueue, messageSize, persistent);
|
