Author: rgreig
Date: Thu Jan 11 11:12:15 2007
New Revision: 495337
URL: http://svn.apache.org/viewvc?view=rev&rev=495337
Log:
QPID-32: fixed test not to use string properties on the messages with timestamps
Modified:
incubator/qpid/trunk/qpid/java/perftests/src/main/java/org/apache/qpid/requestreply/ServiceProvidingClient.java
incubator/qpid/trunk/qpid/java/perftests/src/main/java/org/apache/qpid/requestreply/ServiceRequestingClient.java
Modified:
incubator/qpid/trunk/qpid/java/perftests/src/main/java/org/apache/qpid/requestreply/ServiceProvidingClient.java
URL:
http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/perftests/src/main/java/org/apache/qpid/requestreply/ServiceProvidingClient.java?view=diff&rev=495337&r1=495336&r2=495337
==============================================================================
---
incubator/qpid/trunk/qpid/java/perftests/src/main/java/org/apache/qpid/requestreply/ServiceProvidingClient.java
(original)
+++
incubator/qpid/trunk/qpid/java/perftests/src/main/java/org/apache/qpid/requestreply/ServiceProvidingClient.java
Thu Jan 11 11:12:15 2007
@@ -7,9 +7,9 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -48,7 +48,7 @@
private boolean _isTransactional;
public ServiceProvidingClient(String brokerDetails, String username,
String password,
- String clientName, String virtualPath,
String serviceName,
+ String clientName, String virtualPath,
String serviceName,
String
deliveryModeString, String transactedMode)
throws AMQException, JMSException, URLSyntaxException
{
@@ -56,7 +56,7 @@
_isTransactional = transactedMode.toUpperCase().charAt(0) ==
'T' ? true : false;
_logger.info("Delivery Mode: " + deliveryMode + "\t isTransactional: "
+ _isTransactional);
-
+
_connection = new AMQConnection(brokerDetails, username, password,
clientName, virtualPath);
_connection.setConnectionListener(new ConnectionListener()
@@ -143,11 +143,12 @@
if (tm.propertyExists("timeSent"))
{
_logger.info("timeSent property set on message");
- _logger.info("timeSent value is: " +
tm.getLongProperty("timeSent"));
- msg.setStringProperty("timeSent",
tm.getStringProperty("timeSent"));
+ long timesent = tm.getLongProperty("timeSent");
+ _logger.info("timeSent value is: " + timesent);
+ msg.setLongProperty("timeSent", timesent);
}
_destinationProducer.send(msg);
-
+
if(_isTransactional)
{
_producerSession.commit();
Modified:
incubator/qpid/trunk/qpid/java/perftests/src/main/java/org/apache/qpid/requestreply/ServiceRequestingClient.java
URL:
http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/perftests/src/main/java/org/apache/qpid/requestreply/ServiceRequestingClient.java?view=diff&rev=495337&r1=495336&r2=495337
==============================================================================
---
incubator/qpid/trunk/qpid/java/perftests/src/main/java/org/apache/qpid/requestreply/ServiceRequestingClient.java
(original)
+++
incubator/qpid/trunk/qpid/java/perftests/src/main/java/org/apache/qpid/requestreply/ServiceRequestingClient.java
Thu Jan 11 11:12:15 2007
@@ -7,9 +7,9 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -174,13 +174,13 @@
}
public ServiceRequestingClient(String brokerHosts, String clientID, String
username, String password,
- String vpath, String commandQueueName,
+ String vpath, String commandQueueName,
String
deliveryModeString, String transactedMode,
final int messageCount, final int
messageDataLength) throws AMQException, URLSyntaxException
{
- final int deliveryMode =
deliveryModeString.toUpperCase().charAt(0) == 'P' ? DeliveryMode.PERSISTENT
+ final int deliveryMode =
deliveryModeString.toUpperCase().charAt(0) == 'P' ? DeliveryMode.PERSISTENT
:
DeliveryMode.NON_PERSISTENT;
-
+
_isTransactional = transactedMode.toUpperCase().charAt(0) ==
'T' ? true : false;
_log.info("Delivery Mode: " + deliveryMode + "\t isTransactional: " +
_isTransactional);
@@ -251,12 +251,12 @@
if (i % 1000 == 0)
{
long timeNow = System.currentTimeMillis();
- msg.setStringProperty("timeSent", String.valueOf(timeNow));
+ msg.setLongProperty("timeSent", timeNow);
}
_producer.send(msg);
if(_isTransactional)
{
- _producerSession.commit();
+ _producerSession.commit();
}
}