Permalink
Browse files

Adding a quid module. Does not seem to work too well tho (client fail…

…s to consistently shutdown properly).
  • Loading branch information...
1 parent daa6630 commit 12ff771ae4a7ce8c7ee23e260467ffe343001c76 @chirino committed Jan 14, 2012
View
@@ -0,0 +1,83 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (C) 2009-2010 the original author or authors.
+ See the notice.md file distributed with this work for additional
+ information regarding copyright ownership.
+
+ Licensed 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 KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.fusesource.jmsbenchmark</groupId>
+ <artifactId>jms-benchmark-project</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <relativePath>..</relativePath>
+ </parent>
+
+ <artifactId>jms-benchmark-qpid</artifactId>
+ <name>${project.artifactId}</name>
+
+ <properties>
+ <url>tcp://localhost:5672</url>
+ <user-name>guest</user-name>
+ <password>guest</password>
+ <benchmark-options></benchmark-options>
+ <box>boxname</box>
+ <qpid-version>0.12</qpid-version>
+ </properties>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>org.fusesource.jmsbenchmark</groupId>
+ <artifactId>jms-benchmark</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>qpid-client</artifactId>
+ <version>${qpid-version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-jms_1.1_spec</artifactId>
+ <version>1.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-nop</artifactId>
+ <version>${slf4j-version}</version>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>exec-maven-plugin</artifactId>
+ <version>1.2</version>
+ <configuration>
+ <mainClass>org.fusesource.jmsbenchmark.Benchmark</mainClass>
+ <commandlineArgs>--provider org.fusesource.jmsbenchmark.QpidScenario --display-errors --url ${url} --user-name ${user-name} --password ${password} ${benchmark-options} ${basedir}/../reports/${box}/qpid.json</commandlineArgs>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
@@ -0,0 +1,61 @@
+/**
+ * Copyright (C) 2009-2011 the original author or authors.
+ * See the notice.md file distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * Licensed 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 KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.fusesource.jmsbenchmark
+
+import javax.jms.{Destination, ConnectionFactory}
+import org.apache.qpid.client.{AMQTopic, AMQQueue, AMQConnectionFactory}
+
+object QpidScenario {
+ def main(args:Array[String]):Unit = {
+ val scenario = new QpidScenario
+ scenario.url = "tcp://localhost:5672"
+ scenario.user_name = "guest"
+ scenario.password = "guest"
+ scenario.display_errors = true
+ scenario.message_size = 20
+ scenario.destination_type = "queue"
+ scenario.consumers = 1
+ scenario.run()
+ }
+}
+
+/**
+ * <p>
+ * Qpid implementation of the JMS Scenario class.
+ * </p>
+ *
+ * @author <a href="http://hiramchirino.com">Hiram Chirino</a>
+ */
+class QpidScenario extends JMSClientScenario {
+
+ override protected def factory:ConnectionFactory = {
+ val client_id = user_name
+ val virtual_host = ""
+ new AMQConnectionFactory(url, user_name, password, client_id, virtual_host)
+ }
+
+ override protected def destination(i:Int):Destination = destination_type match {
+ case "queue" =>
+ new AMQQueue("BURL:direct://amq.direct//qload-"+i)
+ case "topic" =>
+ new AMQTopic("BURL:topic://amq.topic/tload"+i+"/sub")
+ case _ =>
+ error("Unsuported destination type: "+destination_type)
+ }
+
+}
View
@@ -102,6 +102,7 @@
<module>jms-benchmark-stomp</module>
<module>jms-benchmark-activemq</module>
<module>jms-benchmark-hornetq</module>
+ <module>jms-benchmark-qpid</module>
</modules>
</project>

0 comments on commit 12ff771

Please sign in to comment.