Skip to content

user guide

凝雨 edited this page Jun 29, 2018 · 10 revisions

How to Use DubboSample

Parameter Comparison Table

Java type paramType paramValue
int int 1
int[] int[] [1, 2]
double double 1.2
double[] double[] [1.2, 1.3]
short short 1
short[] short[] [1, 2]
float float 1.2
float[] float[] [1.2, 1.3]
long long 1
long[] long[] [1, 2]
byte byte byte
byte[] byte[] byte
boolean boolean true
false
boolean[] boolean[] [true, false]
char char A,If the character is too long, the value is:"STR".charAt(0)
char[] char[] [A, B]
java.lang.String java.lang.String
String
string
"foo"
foo
java.lang.String[] java.lang.String[]
String[]
string[]
["foo1", "foo2"]
java.lang.Integer java.lang.Integer
Integer
integer
1
java.lang.Integer[] java.lang.Integer[]
Integer[]
integer[]
[1, 2]
java.lang.Double java.lang.Double
Double
1.2
java.lang.Double[] java.lang.Double[]
Double[]
[1.2, 1.3]
java.lang.Short java.lang.Short
Short
1
java.lang.Short[] java.lang.Short[]
Short[]
[1, 2]
java.lang.Long java.lang.Long
Long
1
java.lang.Long[] java.lang.Long[]
Long[]
[1, 2]
java.lang.Float java.lang.Float
Float
1.2
java.lang.Float[] java.lang.Float[]
Float[]
[1.2, 1.3]
java.lang.Byte java.lang.Byte
Byte
byte
java.lang.Byte[] java.lang.Byte[]
Byte[]
byte
java.lang.Boolean java.lang.Boolean
Boolean
true
false
java.lang.Boolean[] java.lang.Boolean[]
Boolean[]
[true, false]
JavaBean com.your.package.BeanName {"att1":"foo","att2":"foo2"}
JavaBean[] com.your.package.BeanName [{"att1":"foo"}, {"att1":"foo2"}]
java.util.Map java.util.Map {"att1":"foo","att2":"foo2"}
java.util.Map<String,JavaBean> java.util.Map {"keyName":{"att1":"foo"}}
java.util.HashMap<Object,Object> java.util.HashMap {"keyName":{"att1":"foo"}}
java.util.Collection java.util.Collection ["a","b"]
java.util.List<String> java.util.List ["a", "b"]
java.util.List<JavaBean> java.util.List [{"att1":"foo1"}, {"att1":"foo2"}]
java.util.List<Map<Object, JavaBean>> java.util.List [{"keyName1":{"att1":"foo1"}}, {"keyName2":{"att1":"foo1"}}]
java.util.List<Long> java.util.List [1, 2, 3]
java.util.ArrayList<Object> java.util.ArrayList ["foo" , 1, true]

ps. paramValue You can use the jmeter function,such as:{"att1":"foo-${__RandomString(5,12345,ids)}"}

Parameter is null, paramValue pass null or NULL or empty string,paramType is required,such as:

Jmeter Version Support

3.0+

Dubbo Version Support

2.5.x, 2.6.x

Plug-in Install

The plug-in package can be downloaded from github。installation directory ${JMETER_HOME}\lib\ext.

If you're using it jmeter-plugins-dubbo-${version}-jar-with-dependencies.jar Including all dependencies, I recommend this.

If you're using it jmeter-plugins-dubbo-${version}.jar dependencies that need to add their own plug-ins,The dependency package version is as follows:

dubbo-2.5.3.jar
javassist-3.15.0-GA.jar
zookeeper-3.4.6.jar
zkclient-0.1.jar
jline-0.9.94.jar
netty-3.7.0-Final.jar
slf4j-api-1.7.5.jar
log4j-over-slf4j-1.7.5.jar

Interface package

1.3.x版本

No interface package dependencies are required.

1.2.x版本

api-jar installation directory ${JMETER_HOME}\lib\ext.

Getting Started

Start Jmeter, add DubboSample. such as:

DubboSample UI such as:

Pass in the necessary parameters.

Results Snapshot

Notes

  1. Use register multiple addresses use "," split, Use direct connected address is provider ip:port
  2. timeout:Service method invocation timeout (milliseconds)
  3. version:Service version, consistent with service provider version
  4. retries:Remote service call retry times, not including the first call, do not need to retry set to 0
  5. cluster:Cluster, optional: failover/failfast/failsafe/failback/forking
  6. Interface:Full name of the class.
  7. Parameters support any type, base type use:int、float、shot、double、long、byte、boolean、char, Custom classes use the full name of the class。
  8. Parameter values, Base types use values directly, Class use json data.
  9. More Dubbo parameters -> http://dubbo.apache.org/books/dubbo-user-book/references/xml/dubbo-reference.html
Clone this wiki locally