Skip to content

Commit

Permalink
Merge branch 'master' of github.com:jlavallee/JMeter-Rabbit-AMQP
Browse files Browse the repository at this point in the history
Conflicts:
	src/main/com/zeroclue/jmeter/protocol/amqp/AMQPSampler.java
	src/main/com/zeroclue/jmeter/protocol/amqp/gui/AMQPSamplerGui.java
  • Loading branch information
mverteuil authored and jlavallee committed Oct 4, 2014
2 parents ba90d9e + d745790 commit ab39473
Show file tree
Hide file tree
Showing 11 changed files with 878 additions and 169 deletions.
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,9 @@ stats/
target/
gc.log
lib/
/nbproject/private/
/build/
/dist/
/ivy/
*.iml
.idea
28 changes: 27 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,32 @@
# JMeter-Rabbit-AMQP #
==========
======================

A [JMeter](http://jmeter.apache.org/) plugin to publish & consume messages from [RabbitMQ](http://www.rabbitmq.com/) or any [AMQP](http://www.amqp.org/) message broker.


JMeter Runtime Dependencies
---------------------------

Prior to building or installing this JMeter plugin, ensure that the RabbitMQ client library (amqp-client-3.x.x.jar) is installed in JMeter's lib/ directory.


Build Dependencies
------------------

Build dependencies are managed by Ivy. JARs should automagically be downloaded by Ivy as part of the build process.

In addition, you'll need to copy or symlink the following from JMeter's lib/ext directory:
* ApacheJMeter_core.jar


Building
--------

The project is built using Ant. To execute the build script, just execute:
ant


Installing
----------

To install the plugin, build the project and copy the generated JMeterAMQP.jar file from target/dist to JMeter's lib/ext/ directory.
48 changes: 25 additions & 23 deletions build.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0"?>
<project name="JMeter-AMQP" default="package" basedir=".">
<project name="JMeter-AMQP" default="package" basedir="." xmlns:ivy="antlib:org.apache.ivy.ant">
<description>
To build JMeter-AMQP from source:
ant
Expand All @@ -10,22 +10,6 @@
For more info:
ant -projecthelp

Note that you need to have the following jars in lib/ to build JMeter-AMQP:

rabbitmq-client.jar >= 2.6.1 (from http://www.rabbitmq.com)
ApacheJMeter_core.jar (from jmeter-trunk)
commons-codec-1.4.jar (also used by jmeter)
commons-collections-3.2.1.jar
commons-httpclient-3.1.jar
commons-io-1.4.jar
commons-jexl-1.1.jar
commons-lang-2.4.jar
commons-logging-1.1.1.jar
commons-net-1.4.1.jar
jorphan.jar
logkit-2.0.jar


</description>

<!-- Check the Ant version -->
Expand All @@ -45,17 +29,18 @@
<property name="src.java.version" value="1.5"/>
<property name="encoding" value="UTF-8"/>
<property name="includeAntRuntime" value="false"/>
<property name="ivy.install.version" value="2.3.0"/>
<property name="ivy.jar.dir" value="${basedir}/ivy"/>
<property name="ivy.jar.file" value="${ivy.jar.dir}/ivy.jar"/>


<target name="compile" description="Compile.">
<target name="compile" depends="resolve-dependencies" description="Compile.">
<echo>Compiling</echo>
<mkdir dir="${build.dir}"/>
<javac srcdir="${src.dir}" destdir="${build.dir}" optimize="${optimize}" source="${src.java.version}" debug="on" target="${target.java.version}" includeAntRuntime="${includeAntRuntime}" deprecation="${deprecation}" encoding="${encoding}">
<javac classpathref="lib.path.id" srcdir="${src.dir}" destdir="${build.dir}" optimize="${optimize}" source="${src.java.version}" debug="on" target="${target.java.version}" includeAntRuntime="${includeAntRuntime}" deprecation="${deprecation}" encoding="${encoding}">
<include name="**/*.java"/>
<include name="**/*.properties"/>
<classpath>
<pathelement path="${classpath}"/>
<fileset dir="${lib.dir}">
<include name="**/*.jar"/>
</fileset>
<pathelement location="classes"/>
<dirset dir="${build.dir}">
<include name="**/classes"/>
Expand All @@ -65,6 +50,23 @@
</javac>
</target>

<target name="resolve-dependencies" depends="install-ivy" description="Resolving Dependencies.">
<echo>Resolving properties</echo>
<ivy:resolve/>
<ivy:cachepath pathid="lib.path.id" conf="build"/>
</target>

<target name="install-ivy" depends="download-ivy" description="Installing Ivy">
<path id="ivy.lib.path">
<fileset dir="${ivy.jar.dir}" includes="*.jar"/>
</path>
<taskdef resource="org/apache/ivy/ant/antlib.xml" uri="antlib:org.apache.ivy.ant" classpathref="ivy.lib.path"/>
</target>

<target name="download-ivy" unless="skip.ivy.download" description="Download Ivy">
<mkdir dir="${ivy.jar.dir}"/>
<get src="http://repo1.maven.org/maven2/org/apache/ivy/ivy/${ivy.install.version}/ivy-${ivy.install.version}.jar" dest="${ivy.jar.file}" usetimestamp="true"/>
</target>

<target name="package" depends="compile"
description="Compile everything and create the jars">
Expand Down
196 changes: 196 additions & 0 deletions examples/RPC_Load_Test.jmx
Original file line number Diff line number Diff line change
@@ -0,0 +1,196 @@
<?xml version="1.0" encoding="UTF-8"?>
<jmeterTestPlan version="1.2" properties="2.4" jmeter="2.9 r1437961">
<hashTree>
<TestPlan guiclass="TestPlanGui" testclass="TestPlan" testname="RPC Test Plan" enabled="true">
<stringProp name="TestPlan.comments"></stringProp>
<boolProp name="TestPlan.functional_mode">false</boolProp>
<boolProp name="TestPlan.serialize_threadgroups">false</boolProp>
<elementProp name="TestPlan.user_defined_variables" elementType="Arguments" guiclass="ArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true">
<collectionProp name="Arguments.arguments"/>
</elementProp>
<stringProp name="TestPlan.user_define_classpath"></stringProp>
</TestPlan>
<hashTree>
<ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="Thread Group" enabled="true">
<stringProp name="ThreadGroup.on_sample_error">stoptest</stringProp>
<elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="Loop Controller" enabled="true">
<boolProp name="LoopController.continue_forever">false</boolProp>
<stringProp name="LoopController.loops">125</stringProp>
</elementProp>
<stringProp name="ThreadGroup.num_threads">8</stringProp>
<stringProp name="ThreadGroup.ramp_time">15</stringProp>
<longProp name="ThreadGroup.start_time">1361373100000</longProp>
<longProp name="ThreadGroup.end_time">1361373100000</longProp>
<boolProp name="ThreadGroup.scheduler">false</boolProp>
<stringProp name="ThreadGroup.duration"></stringProp>
<stringProp name="ThreadGroup.delay"></stringProp>
</ThreadGroup>
<hashTree>
<RandomVariableConfig guiclass="TestBeanGUI" testclass="RandomVariableConfig" testname="Reply-To Queue Name" enabled="true">
<stringProp name="maximumValue">999999999</stringProp>
<stringProp name="minimumValue">1</stringProp>
<stringProp name="outputFormat">000000000</stringProp>
<boolProp name="perThread">false</boolProp>
<stringProp name="randomSeed"></stringProp>
<stringProp name="variableName">replyToQueue</stringProp>
</RandomVariableConfig>
<hashTree/>
<RandomVariableConfig guiclass="TestBeanGUI" testclass="RandomVariableConfig" testname="Unique ID" enabled="true">
<stringProp name="variableName">uniqueId</stringProp>
<stringProp name="outputFormat">0000000</stringProp>
<stringProp name="minimumValue">1</stringProp>
<stringProp name="maximumValue">9999999</stringProp>
<stringProp name="randomSeed">3499272</stringProp>
<boolProp name="perThread">false</boolProp>
</RandomVariableConfig>
<hashTree/>
<TransactionController guiclass="TransactionControllerGui" testclass="TransactionController" testname="RPC Endpoint" enabled="true">
<boolProp name="TransactionController.parent">true</boolProp>
<boolProp name="TransactionController.includeTimers">false</boolProp>
</TransactionController>
<hashTree>
<com.zeroclue.jmeter.protocol.amqp.AMQPPublisher guiclass="com.zeroclue.jmeter.protocol.amqp.gui.AMQPPublisherGui" testclass="com.zeroclue.jmeter.protocol.amqp.AMQPPublisher" testname="RPC Request" enabled="true">
<stringProp name="AMQPSampler.Exchange">my_rpc_exchange</stringProp>
<stringProp name="AMQPSampler.Queue">RPCRequestQueue</stringProp>
<stringProp name="AMQPSampler.RoutingKey">RPCMessage.Request.v1_0</stringProp>
<stringProp name="AMQPSampler.VirtualHost">/</stringProp>
<stringProp name="AMQPSampler.MessageTTL"></stringProp>
<stringProp name="AMQPSampler.ExchangeType">direct</stringProp>
<stringProp name="AMQPSampler.QueueDurable">true</stringProp>
<stringProp name="AMQPSampler.QueueExclusive">false</stringProp>
<stringProp name="AMQPSampler.QueueAutoDelete">false</stringProp>
<stringProp name="AMQPSampler.Timeout">1000</stringProp>
<stringProp name="AMQPSampler.Host">localhost</stringProp>
<stringProp name="AMQPSampler.Port">5672</stringProp>
<stringProp name="AMQPSampler.Username">guest</stringProp>
<stringProp name="AMQPSampler.Password">guest</stringProp>
<stringProp name="AMQPPublisher.MessageRoutingKey">RPCMessage.Request.v1_0</stringProp>
<stringProp name="AMQPPublisher.Message">{
&quot;RequestMessageText&quot;: &apos;${uniqueId}&apos;
}</stringProp>
<stringProp name="AMQPPublisher.MessageType">RPCMessageRequest</stringProp>
<stringProp name="AMQPPublisher.ReplyToQueue">jMeter_${__threadNum}_${replyToQueue}</stringProp>
<stringProp name="AMQPPublisher.CorrelationId">${uniqueId}</stringProp>
</com.zeroclue.jmeter.protocol.amqp.AMQPPublisher>
<hashTree/>
<com.zeroclue.jmeter.protocol.amqp.AMQPConsumer guiclass="com.zeroclue.jmeter.protocol.amqp.gui.AMQPConsumerGui" testclass="com.zeroclue.jmeter.protocol.amqp.AMQPConsumer" testname="RPC Response" enabled="true">
<stringProp name="AMQPSampler.Exchange"></stringProp>
<stringProp name="AMQPSampler.Queue">jMeter_${__threadNum}_${replyToQueue}</stringProp>
<stringProp name="AMQPSampler.RoutingKey">RPCMessage.Request.v1_0</stringProp>
<stringProp name="AMQPSampler.VirtualHost">/</stringProp>
<stringProp name="AMQPSampler.MessageTTL"></stringProp>
<stringProp name="AMQPSampler.ExchangeType">direct</stringProp>
<stringProp name="AMQPSampler.QueueDurable">false</stringProp>
<stringProp name="AMQPSampler.QueueExclusive">true</stringProp>
<stringProp name="AMQPSampler.QueueAutoDelete">true</stringProp>
<stringProp name="AMQPSampler.Timeout">1000</stringProp>
<stringProp name="AMQPSampler.Host">localhost</stringProp>
<stringProp name="AMQPSampler.Port">5672</stringProp>
<stringProp name="AMQPSampler.Username">guest</stringProp>
<stringProp name="AMQPSampler.Password">guest</stringProp>
<stringProp name="AMQPConsumer.ReceiveTimeout">10000</stringProp>
<stringProp name="AMQPConsumer.PurgeQueue">false</stringProp>
<stringProp name="AMQPConsumer.AutoAck">true</stringProp>
</com.zeroclue.jmeter.protocol.amqp.AMQPConsumer>
<hashTree/>
</hashTree>
<ResultCollector guiclass="GraphVisualizer" testclass="ResultCollector" testname="Graph Results" enabled="true">
<boolProp name="ResultCollector.error_logging">false</boolProp>
<objProp>
<name>saveConfig</name>
<value class="SampleSaveConfiguration">
<time>true</time>
<latency>true</latency>
<timestamp>true</timestamp>
<success>true</success>
<label>true</label>
<code>true</code>
<message>true</message>
<threadName>true</threadName>
<dataType>true</dataType>
<encoding>false</encoding>
<assertions>true</assertions>
<subresults>true</subresults>
<responseData>false</responseData>
<samplerData>false</samplerData>
<xml>false</xml>
<fieldNames>false</fieldNames>
<responseHeaders>false</responseHeaders>
<requestHeaders>false</requestHeaders>
<responseDataOnError>false</responseDataOnError>
<saveAssertionResultsFailureMessage>false</saveAssertionResultsFailureMessage>
<assertionsResultsToSave>0</assertionsResultsToSave>
<bytes>true</bytes>
</value>
</objProp>
<stringProp name="filename"></stringProp>
</ResultCollector>
<hashTree/>
<ResultCollector guiclass="StatVisualizer" testclass="ResultCollector" testname="Aggregate Report" enabled="true">
<boolProp name="ResultCollector.error_logging">false</boolProp>
<objProp>
<name>saveConfig</name>
<value class="SampleSaveConfiguration">
<time>true</time>
<latency>true</latency>
<timestamp>true</timestamp>
<success>true</success>
<label>true</label>
<code>true</code>
<message>true</message>
<threadName>true</threadName>
<dataType>true</dataType>
<encoding>false</encoding>
<assertions>true</assertions>
<subresults>true</subresults>
<responseData>false</responseData>
<samplerData>false</samplerData>
<xml>false</xml>
<fieldNames>false</fieldNames>
<responseHeaders>false</responseHeaders>
<requestHeaders>false</requestHeaders>
<responseDataOnError>false</responseDataOnError>
<saveAssertionResultsFailureMessage>false</saveAssertionResultsFailureMessage>
<assertionsResultsToSave>0</assertionsResultsToSave>
<bytes>true</bytes>
</value>
</objProp>
<stringProp name="filename"></stringProp>
</ResultCollector>
<hashTree/>
<ResultCollector guiclass="ViewResultsFullVisualizer" testclass="ResultCollector" testname="View Respones" enabled="true">
<boolProp name="ResultCollector.error_logging">false</boolProp>
<objProp>
<name>saveConfig</name>
<value class="SampleSaveConfiguration">
<time>true</time>
<latency>true</latency>
<timestamp>true</timestamp>
<success>true</success>
<label>true</label>
<code>true</code>
<message>true</message>
<threadName>true</threadName>
<dataType>true</dataType>
<encoding>false</encoding>
<assertions>true</assertions>
<subresults>true</subresults>
<responseData>false</responseData>
<samplerData>false</samplerData>
<xml>false</xml>
<fieldNames>false</fieldNames>
<responseHeaders>false</responseHeaders>
<requestHeaders>false</requestHeaders>
<responseDataOnError>false</responseDataOnError>
<saveAssertionResultsFailureMessage>false</saveAssertionResultsFailureMessage>
<assertionsResultsToSave>0</assertionsResultsToSave>
<bytes>true</bytes>
</value>
</objProp>
<stringProp name="filename"></stringProp>
</ResultCollector>
<hashTree/>
</hashTree>
</hashTree>
</hashTree>
</jmeterTestPlan>
21 changes: 21 additions & 0 deletions ivy.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<ivy-module version="2.0">
<info organisation="com.zeroclue.jmeter.protocol.amqp" module="jmeter-rabbit-amqp"/>
<configurations>
<conf name="build" description="Libraries needed to for compilation"/>
<conf name="runtime" extends="build" description="Libraries that need to be included with project jar" />
</configurations>
<dependencies>
<dependency org="org.apache.commons" name="commons-lang3" rev="3.0" conf="build->default"/>
<dependency org="commons-io" name="commons-io" rev="1.4" conf="build->default"/>
<dependency org="commons-jexl" name="commons-jexl" rev="1.1" conf="build->default"/>
<dependency org="commons-codec" name="commons-codec" rev="1.4" conf="build->default"/>
<dependency org="commons-collections" name="commons-collections" rev="3.2.1" conf="build->default"/>
<dependency org="commons-httpclient" name="commons-httpclient" rev="3.1" conf="build->default"/>
<dependency org="commons-logging" name="commons-logging" rev="1.1.1" conf="build->default"/>
<dependency org="commons-net" name="commons-net" rev="1.4.1" conf="build->default"/>
<dependency org="org.apache.jmeter" name="jorphan" rev="2.6" conf="build->default"/>
<dependency org="avalon-logkit" name="avalon-logkit" rev="2.0" conf="build->default"/>
<dependency org="com.rabbitmq" name="amqp-client" rev="3.3.4" conf="build->default"/>
<dependency org="org.apache.jmeter" name="ApacheJMeter_core" rev="2.11" conf="build->default"/>
</dependencies>
</ivy-module>
Loading

0 comments on commit ab39473

Please sign in to comment.