initial checkin for dubbo benchmark and profile
diff --git a/.gitignore b/.gitignore
index a1c2a23..2d74208 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,5 +1,6 @@
# Compiled class file
*.class
+target/
# Log file
*.log
@@ -21,3 +22,10 @@
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
+
+# intellij idea
+*.iml
+.idea/
+
+# preflight record result
+*.jfr
diff --git a/benchmark-base/pom.xml b/benchmark-base/pom.xml
new file mode 100644
index 0000000..88cd301
--- /dev/null
+++ b/benchmark-base/pom.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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/xsd/maven-4.0.0.xsd">
+ <parent>
+ <artifactId>dubbo-benchmark</artifactId>
+ <groupId>org.apache.dubbo</groupId>
+ <version>1.0-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+
+ <artifactId>benchmark-base</artifactId>
+
+
+</project>
\ No newline at end of file
diff --git a/benchmark-base/src/main/java/org/apache/dubbo/benchmark/bean/Page.java b/benchmark-base/src/main/java/org/apache/dubbo/benchmark/bean/Page.java
new file mode 100644
index 0000000..6cf1f1d
--- /dev/null
+++ b/benchmark-base/src/main/java/org/apache/dubbo/benchmark/bean/Page.java
@@ -0,0 +1,41 @@
+package org.apache.dubbo.benchmark.bean;
+
+import java.io.Serializable;
+import java.util.List;
+
+public class Page<T> implements Serializable {
+ private static final long serialVersionUID = -7529237188686406553L;
+
+ private int pageNo;
+ private int total;
+ private List<T> result;
+
+ public int getPageNo() {
+ return pageNo;
+ }
+
+ public void setPageNo(int pageNo) {
+ this.pageNo = pageNo;
+ }
+
+ public int getTotal() {
+ return total;
+ }
+
+ public void setTotal(int total) {
+ this.total = total;
+ }
+
+ public List<T> getResult() {
+ return result;
+ }
+
+ public void setResult(List<T> result) {
+ this.result = result;
+ }
+
+ @Override
+ public String toString() {
+ return "Page [pageNo=" + pageNo + ", total=" + total + ", result=" + result + "]";
+ }
+}
diff --git a/benchmark-base/src/main/java/org/apache/dubbo/benchmark/bean/User.java b/benchmark-base/src/main/java/org/apache/dubbo/benchmark/bean/User.java
new file mode 100644
index 0000000..cecb779
--- /dev/null
+++ b/benchmark-base/src/main/java/org/apache/dubbo/benchmark/bean/User.java
@@ -0,0 +1,128 @@
+package org.apache.dubbo.benchmark.bean;
+
+import java.io.Serializable;
+import java.time.LocalDate;
+import java.time.LocalDateTime;
+import java.util.List;
+
+public class User implements Serializable {
+ private static final long serialVersionUID = 2566816725396650300L;
+
+ private long id;
+ private String name;
+ private int sex;
+ private LocalDate birthday;
+ private String email;
+ private String mobile;
+ private String address;
+ private String icon;
+ private List<Integer> permissions;
+ private int status;
+ private LocalDateTime createTime;
+ private LocalDateTime updateTime;
+
+ public long getId() {
+ return id;
+ }
+
+ public void setId(long id) {
+ this.id = id;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public int getSex() {
+ return sex;
+ }
+
+ public void setSex(int sex) {
+ this.sex = sex;
+ }
+
+ public LocalDate getBirthday() {
+ return birthday;
+ }
+
+ public void setBirthday(LocalDate birthday) {
+ this.birthday = birthday;
+ }
+
+ public String getEmail() {
+ return email;
+ }
+
+ public void setEmail(String email) {
+ this.email = email;
+ }
+
+ public String getMobile() {
+ return mobile;
+ }
+
+ public void setMobile(String mobile) {
+ this.mobile = mobile;
+ }
+
+ public String getAddress() {
+ return address;
+ }
+
+ public void setAddress(String address) {
+ this.address = address;
+ }
+
+ public String getIcon() {
+ return icon;
+ }
+
+ public void setIcon(String icon) {
+ this.icon = icon;
+ }
+
+ public List<Integer> getPermissions() {
+ return permissions;
+ }
+
+ public void setPermissions(List<Integer> permissions) {
+ this.permissions = permissions;
+ }
+
+ public int getStatus() {
+ return status;
+ }
+
+ public void setStatus(int status) {
+ this.status = status;
+ }
+
+ public LocalDateTime getCreateTime() {
+ return createTime;
+ }
+
+ public void setCreateTime(LocalDateTime createTime) {
+ this.createTime = createTime;
+ }
+
+ public LocalDateTime getUpdateTime() {
+ return updateTime;
+ }
+
+ public void setUpdateTime(LocalDateTime updateTime) {
+ this.updateTime = updateTime;
+ }
+
+ @Override
+ public String toString() {
+ return "User [id=" + id + ", name=" + name + ", sex=" + sex + ", birthday=" + birthday + ", email=" + email
+ + ", mobile=" + mobile + ", address=" + address + ", icon=" + icon + ", permissions=" + permissions
+ + ", status=" + status + ", createTime=" + createTime + ", updateTime=" + updateTime + "]";
+ }
+
+}
+
diff --git a/benchmark-base/src/main/java/org/apache/dubbo/benchmark/rpc/AbstractClient.java b/benchmark-base/src/main/java/org/apache/dubbo/benchmark/rpc/AbstractClient.java
new file mode 100644
index 0000000..f6556f2
--- /dev/null
+++ b/benchmark-base/src/main/java/org/apache/dubbo/benchmark/rpc/AbstractClient.java
@@ -0,0 +1,38 @@
+package org.apache.dubbo.benchmark.rpc;
+
+import org.apache.dubbo.benchmark.bean.Page;
+import org.apache.dubbo.benchmark.bean.User;
+import org.apache.dubbo.benchmark.service.UserService;
+import org.apache.dubbo.benchmark.service.UserServiceServerImpl;
+
+import java.util.concurrent.atomic.AtomicInteger;
+
+public abstract class AbstractClient {
+ private final AtomicInteger counter = new AtomicInteger(0);
+ private final UserService _serviceUserService = new UserServiceServerImpl();
+
+ protected abstract UserService getUserService();
+
+ public boolean existUser() throws Exception {
+ String email = String.valueOf(counter.getAndIncrement());
+ return getUserService().existUser(email);
+ }
+
+ public boolean createUser() throws Exception {
+ int id = counter.getAndIncrement();
+ User user = _serviceUserService.getUser(id);
+ return getUserService().createUser(user);
+ }
+
+ public User getUser() throws Exception {
+ int id = counter.getAndIncrement();
+ return getUserService().getUser(id);
+ }
+
+ public Page<User> listUser() throws Exception {
+ int pageNo = counter.getAndIncrement();
+ return getUserService().listUser(pageNo);
+ }
+
+}
+
diff --git a/benchmark-base/src/main/java/org/apache/dubbo/benchmark/serialize/SerializationOptimizerImpl.java b/benchmark-base/src/main/java/org/apache/dubbo/benchmark/serialize/SerializationOptimizerImpl.java
new file mode 100644
index 0000000..9c47274
--- /dev/null
+++ b/benchmark-base/src/main/java/org/apache/dubbo/benchmark/serialize/SerializationOptimizerImpl.java
@@ -0,0 +1,16 @@
+package org.apache.dubbo.benchmark.serialize;
+
+import com.alibaba.dubbo.common.serialize.support.SerializationOptimizer;
+import org.apache.dubbo.benchmark.bean.Page;
+import org.apache.dubbo.benchmark.bean.User;
+import org.apache.dubbo.benchmark.service.UserService;
+
+import java.util.Arrays;
+import java.util.Collection;
+
+public class SerializationOptimizerImpl implements SerializationOptimizer {
+ @Override
+ public Collection<Class> getSerializableClasses() {
+ return Arrays.asList(User.class, Page.class, UserService.class);
+ }
+}
diff --git a/benchmark-base/src/main/java/org/apache/dubbo/benchmark/service/UserService.java b/benchmark-base/src/main/java/org/apache/dubbo/benchmark/service/UserService.java
new file mode 100644
index 0000000..9f4a164
--- /dev/null
+++ b/benchmark-base/src/main/java/org/apache/dubbo/benchmark/service/UserService.java
@@ -0,0 +1,17 @@
+package org.apache.dubbo.benchmark.service;
+
+
+import org.apache.dubbo.benchmark.bean.Page;
+import org.apache.dubbo.benchmark.bean.User;
+
+public interface UserService {
+ public boolean existUser(String email);
+
+ public boolean createUser(User user);
+
+ public User getUser(long id);
+
+ public Page<User> listUser(int pageNo);
+
+}
+
diff --git a/benchmark-base/src/main/java/org/apache/dubbo/benchmark/service/UserServiceServerImpl.java b/benchmark-base/src/main/java/org/apache/dubbo/benchmark/service/UserServiceServerImpl.java
new file mode 100644
index 0000000..34db9c0
--- /dev/null
+++ b/benchmark-base/src/main/java/org/apache/dubbo/benchmark/service/UserServiceServerImpl.java
@@ -0,0 +1,97 @@
+package org.apache.dubbo.benchmark.service;
+
+
+import org.apache.dubbo.benchmark.bean.Page;
+import org.apache.dubbo.benchmark.bean.User;
+
+import java.time.LocalDate;
+import java.time.LocalDateTime;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+
+public class UserServiceServerImpl implements UserService {
+
+ @Override
+ public boolean existUser(String email) {
+ if (email == null || email.isEmpty()) {
+ return true;
+ }
+
+ if (email.charAt(email.length() - 1) < '5') {
+ return false;
+ }
+
+ return true;
+ }
+
+ @Override
+ public User getUser(long id) {
+ User user = new User();
+
+ user.setId(id);
+ user.setName(new String("Doug Lea"));
+ user.setSex(1);
+ user.setBirthday(LocalDate.of(1968, 12, 8));
+ user.setEmail(new String("dong.lea@gmail.com"));
+ user.setMobile(new String("18612345678"));
+ user.setAddress(new String("北京市 中关村 中关村大街1号 鼎好大厦 1605"));
+ user.setIcon(new String("https://www.baidu.com/img/bd_logo1.png"));
+ user.setStatus(1);
+ user.setCreateTime(LocalDateTime.now());
+ user.setUpdateTime(user.getCreateTime());
+
+ List<Integer> permissions = new ArrayList<Integer>(
+ Arrays.asList(1, 2, 3, 4, 5, 6, 7, 8, 19, 88, 86, 89, 90, 91, 92));
+
+ user.setPermissions(permissions);
+
+ return user;
+ }
+
+ @Override
+ public Page<User> listUser(int pageNo) {
+ List<User> userList = new ArrayList<>(15);
+
+ for (int i = 0; i < 15; i++) {
+ User user = new User();
+
+ user.setId(i);
+ user.setName("Doug Lea" + i);
+ user.setSex(1);
+ user.setBirthday(LocalDate.of(1968, 12, 8));
+ user.setEmail("dong.lea@gmail.com" + i);
+ user.setMobile("18612345678" + i);
+ user.setAddress("北京市 中关村 中关村大街1号 鼎好大厦 1605" + i);
+ user.setIcon("https://www.baidu.com/img/bd_logo1.png" + i);
+ user.setStatus(1);
+ user.setCreateTime(LocalDateTime.now());
+ user.setUpdateTime(user.getCreateTime());
+
+ List<Integer> permissions = new ArrayList<Integer>(
+ Arrays.asList(1, 2, 3, 4, 5, 6, 7, 8, 19, 88, 86, 89, 90, 91, 92));
+ user.setPermissions(permissions);
+
+ userList.add(user);
+ }
+
+ Page<User> page = new Page<>();
+ page.setPageNo(pageNo);
+ page.setTotal(1000);
+ page.setResult(userList);
+
+ return page;
+ }
+
+ @Override
+ public boolean createUser(User user) {
+ if (user == null) {
+ return false;
+ }
+
+ return true;
+ }
+
+}
+
diff --git a/benchmark.sh b/benchmark.sh
new file mode 100755
index 0000000..1959c92
--- /dev/null
+++ b/benchmark.sh
@@ -0,0 +1,52 @@
+#!/usr/bin/env bash
+
+PROGRAM_NAME=$0
+TASK=$1
+PROFILE=$2
+
+if [ ! -d "${TASK}" ]; then
+ usage
+fi
+
+usage() {
+ echo "Usage: ${PROGRAM_NAME} directory-name {profiling|benchmark}"
+ echo "run in benchmark mode by default if mode is not specified."
+ exit 2
+}
+
+build() {
+ mvn clean package
+}
+
+options() {
+ JAVA_OPTIONS="-server -Xmx1g -Xms1g -XX:MaxDirectMemorySize=1g -XX:+UseG1GC"
+ if [ "x${PROFILE}" = "xprofiling" ]; then
+ JAVA_OPTIONS="${JAVA_OPTIONS} \
+-XX:+UnlockCommercialFeatures \
+-XX:+FlightRecorder \
+-XX:StartFlightRecording=duration=30s,filename=${TASK}.jfr \
+-XX:FlightRecorderOptions=stackdepth=256"
+ fi
+}
+
+run() {
+ if [ -d "${TASK}/target" ]; then
+ JAR=`find ${TASK}/target/*.jar | head -n 1`
+ echo
+ echo "RUN ${TASK} IN ${PROFILE:-benchmark} MODE"
+ CMD="java ${JAVA_OPTIONS} -jar ${JAR}"
+ echo "command is: ${CMD}"
+ echo
+ ${CMD}
+ fi
+}
+
+build
+options
+run
+
+
+
+
+
+
diff --git a/dubbo-hessianlite-client/pom.xml b/dubbo-hessianlite-client/pom.xml
new file mode 100644
index 0000000..36640db
--- /dev/null
+++ b/dubbo-hessianlite-client/pom.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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/xsd/maven-4.0.0.xsd">
+ <parent>
+ <artifactId>dubbo-benchmark</artifactId>
+ <groupId>org.apache.dubbo</groupId>
+ <version>1.0-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+
+ <artifactId>dubbo-hessianlite-client</artifactId>
+
+
+</project>
\ No newline at end of file
diff --git a/dubbo-hessianlite-client/src/main/java/org/apache/dubbo/benchmark/Client.java b/dubbo-hessianlite-client/src/main/java/org/apache/dubbo/benchmark/Client.java
new file mode 100644
index 0000000..08fe221
--- /dev/null
+++ b/dubbo-hessianlite-client/src/main/java/org/apache/dubbo/benchmark/Client.java
@@ -0,0 +1,95 @@
+package org.apache.dubbo.benchmark;
+
+import com.alibaba.dubbo.config.ProtocolConfig;
+import org.apache.dubbo.benchmark.bean.Page;
+import org.apache.dubbo.benchmark.bean.User;
+import org.apache.dubbo.benchmark.rpc.AbstractClient;
+import org.apache.dubbo.benchmark.service.UserService;
+import org.openjdk.jmh.annotations.Benchmark;
+import org.openjdk.jmh.annotations.BenchmarkMode;
+import org.openjdk.jmh.annotations.Mode;
+import org.openjdk.jmh.annotations.OutputTimeUnit;
+import org.openjdk.jmh.annotations.Scope;
+import org.openjdk.jmh.annotations.State;
+import org.openjdk.jmh.annotations.TearDown;
+import org.openjdk.jmh.results.format.ResultFormatType;
+import org.openjdk.jmh.runner.Runner;
+import org.openjdk.jmh.runner.options.Options;
+import org.openjdk.jmh.runner.options.OptionsBuilder;
+import org.openjdk.jmh.runner.options.TimeValue;
+import org.springframework.context.support.ClassPathXmlApplicationContext;
+
+import java.io.IOException;
+import java.util.concurrent.TimeUnit;
+
+@State(Scope.Benchmark)
+public class Client extends AbstractClient {
+ private static final int CONCURRENCY = 32;
+
+ private final ClassPathXmlApplicationContext context;
+ private final UserService userService;
+
+ public Client() {
+ context = new ClassPathXmlApplicationContext("consumer.xml");
+ context.start();
+ userService = (UserService) context.getBean("userService");
+ }
+
+ @Override
+ protected UserService getUserService() {
+ return userService;
+ }
+
+ @TearDown
+ public void close() throws IOException {
+ context.close();
+ ProtocolConfig.destroyAll();
+ }
+
+ @Benchmark
+ @BenchmarkMode({Mode.Throughput, Mode.AverageTime, Mode.SampleTime})
+ @OutputTimeUnit(TimeUnit.MILLISECONDS)
+ @Override
+ public boolean existUser() throws Exception {
+ return super.existUser();
+ }
+
+ @Benchmark
+ @BenchmarkMode({Mode.Throughput, Mode.AverageTime, Mode.SampleTime})
+ @OutputTimeUnit(TimeUnit.MILLISECONDS)
+ @Override
+ public boolean createUser() throws Exception {
+ return super.createUser();
+ }
+
+ @Benchmark
+ @BenchmarkMode({Mode.Throughput, Mode.AverageTime, Mode.SampleTime})
+ @OutputTimeUnit(TimeUnit.MILLISECONDS)
+ @Override
+ public User getUser() throws Exception {
+ return super.getUser();
+ }
+
+ @Benchmark
+ @BenchmarkMode({Mode.Throughput, Mode.AverageTime, Mode.SampleTime})
+ @OutputTimeUnit(TimeUnit.MILLISECONDS)
+ @Override
+ public Page<User> listUser() throws Exception {
+ return super.listUser();
+ }
+
+ public static void main(String[] args) throws Exception {
+ Options opt = new OptionsBuilder()
+ .include(Client.class.getSimpleName())
+ .warmupIterations(3)
+ .warmupTime(TimeValue.seconds(10))
+ .measurementIterations(3)
+ .measurementTime(TimeValue.seconds(10))
+ .threads(CONCURRENCY)
+ .resultFormat(ResultFormatType.JSON)
+ .forks(1)
+ .build();
+
+ new Runner(opt).run();
+ }
+}
diff --git a/dubbo-hessianlite-client/src/main/resources/benchmark.properties b/dubbo-hessianlite-client/src/main/resources/benchmark.properties
new file mode 100644
index 0000000..9d276bf
--- /dev/null
+++ b/dubbo-hessianlite-client/src/main/resources/benchmark.properties
@@ -0,0 +1,2 @@
+server.host=localhost
+server.port=8080
\ No newline at end of file
diff --git a/dubbo-hessianlite-client/src/main/resources/consumer.xml b/dubbo-hessianlite-client/src/main/resources/consumer.xml
new file mode 100644
index 0000000..22c89f9
--- /dev/null
+++ b/dubbo-hessianlite-client/src/main/resources/consumer.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:dubbo="http://code.alibabatech.com/schema/dubbo"
+ xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://code.alibabatech.com/schema/dubbo http://code.alibabatech.com/schema/dubbo/dubbo.xsd">
+ <dubbo:application name="dubbo-client-kyro"/>
+ <dubbo:reference id="userService" check="false"
+ interface="org.apache.dubbo.benchmark.service.UserService"
+ url="dubbo://localhost:8080?optimizer=org.apache.dubbo.benchmark.serialize.SerializationOptimizerImpl&serialization=kryo"/>
+ <dubbo:consumer client="netty4" filter="-default"/>
+</beans>
\ No newline at end of file
diff --git a/dubbo-hessianlite-client/src/main/resources/logback.xml b/dubbo-hessianlite-client/src/main/resources/logback.xml
new file mode 100644
index 0000000..cb8c9fd
--- /dev/null
+++ b/dubbo-hessianlite-client/src/main/resources/logback.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<configuration>
+ <jmxConfigurator/>
+
+ <appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
+ <encoder>
+ <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n
+ </pattern>
+ </encoder>
+ </appender>
+
+ <appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
+ <file>logs/dubbo-kyro-client.log</file>
+ <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
+ <fileNamePattern>logs/benchmark-rpc-client.%d{yyyy-MM-dd}.log.gz</fileNamePattern>
+ </rollingPolicy>
+ <encoder>
+ <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n </pattern>
+ </encoder>
+ </appender>
+
+ <logger name="benchmark.rpc" level="INFO"/>
+
+ <root level="INFO">
+ <appender-ref ref="CONSOLE" />
+ <appender-ref ref="FILE"/>
+ </root>
+</configuration>
diff --git a/dubbo-hessianlite-server/pom.xml b/dubbo-hessianlite-server/pom.xml
new file mode 100644
index 0000000..7b095f2
--- /dev/null
+++ b/dubbo-hessianlite-server/pom.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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/xsd/maven-4.0.0.xsd">
+ <parent>
+ <artifactId>dubbo-benchmark</artifactId>
+ <groupId>org.apache.dubbo</groupId>
+ <version>1.0-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+
+ <artifactId>dubbo-hessianlite-server</artifactId>
+
+
+</project>
\ No newline at end of file
diff --git a/dubbo-hessianlite-server/src/main/java/org/apache/dubbo/benchmark/Server.java b/dubbo-hessianlite-server/src/main/java/org/apache/dubbo/benchmark/Server.java
new file mode 100644
index 0000000..6787d36
--- /dev/null
+++ b/dubbo-hessianlite-server/src/main/java/org/apache/dubbo/benchmark/Server.java
@@ -0,0 +1,14 @@
+package org.apache.dubbo.benchmark;
+
+import org.springframework.context.support.ClassPathXmlApplicationContext;
+
+public class Server {
+
+ public static void main(String[] args) throws InterruptedException {
+ try (ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("provider.xml")) {
+ context.start();
+ Thread.sleep(Integer.MAX_VALUE);
+ }
+ }
+
+}
diff --git a/dubbo-hessianlite-server/src/main/resources/benchmark.properties b/dubbo-hessianlite-server/src/main/resources/benchmark.properties
new file mode 100644
index 0000000..9d276bf
--- /dev/null
+++ b/dubbo-hessianlite-server/src/main/resources/benchmark.properties
@@ -0,0 +1,2 @@
+server.host=localhost
+server.port=8080
\ No newline at end of file
diff --git a/dubbo-hessianlite-server/src/main/resources/logback.xml b/dubbo-hessianlite-server/src/main/resources/logback.xml
new file mode 100644
index 0000000..6b20820
--- /dev/null
+++ b/dubbo-hessianlite-server/src/main/resources/logback.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<configuration>
+ <jmxConfigurator/>
+
+ <appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
+ <encoder>
+ <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n
+ </pattern>
+ </encoder>
+ </appender>
+
+ <appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
+ <file>logs/dubbo-kryo-server.log</file>
+ <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
+ <fileNamePattern>logs/dubbo-kryo-server.%d{yyyy-MM-dd}.log.gz</fileNamePattern>
+ </rollingPolicy>
+ <encoder>
+ <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
+ </encoder>
+ </appender>
+
+ <root level="INFO">
+ <appender-ref ref="CONSOLE"/>
+ <appender-ref ref="FILE"/>
+ </root>
+</configuration>
diff --git a/dubbo-hessianlite-server/src/main/resources/provider.xml b/dubbo-hessianlite-server/src/main/resources/provider.xml
new file mode 100644
index 0000000..c0ba8cd
--- /dev/null
+++ b/dubbo-hessianlite-server/src/main/resources/provider.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:dubbo="http://code.alibabatech.com/schema/dubbo"
+ xmlns:context="http://www.springframework.org/schema/context"
+ xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://code.alibabatech.com/schema/dubbo http://code.alibabatech.com/schema/dubbo/dubbo.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">
+ <context:property-placeholder location="classpath:benchmark.properties" system-properties-mode="OVERRIDE"/>
+ <dubbo:application name="dubbo-kryo-server"/>
+ <dubbo:protocol name="dubbo" host="${server.host}" server="netty4" port="${server.port}" serialization="kryo"
+ optimizer="org.apache.dubbo.benchmark.serialize.SerializationOptimizerImpl"/>
+ <dubbo:registry address="N/A"/>
+ <dubbo:service interface="org.apache.dubbo.benchmark.service.UserService" ref="userService" filter="-default"/>
+ <bean id="userService" class="org.apache.dubbo.benchmark.service.UserServiceServerImpl"/>
+</beans>
\ No newline at end of file
diff --git a/dubbo-kryo-client/pom.xml b/dubbo-kryo-client/pom.xml
new file mode 100644
index 0000000..eeee860
--- /dev/null
+++ b/dubbo-kryo-client/pom.xml
@@ -0,0 +1,83 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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/xsd/maven-4.0.0.xsd">
+ <parent>
+ <artifactId>dubbo-benchmark</artifactId>
+ <groupId>org.apache.dubbo</groupId>
+ <version>1.0-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+
+ <artifactId>dubbo-client-kryo</artifactId>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.dubbo</groupId>
+ <artifactId>benchmark-base</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>com.esotericsoftware</groupId>
+ <artifactId>kryo</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>de.javakaffee</groupId>
+ <artifactId>kryo-serializers</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>com.esotericsoftware</groupId>
+ <artifactId>kryo</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.openjdk.jmh</groupId>
+ <artifactId>jmh-core</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.openjdk.jmh</groupId>
+ <artifactId>jmh-generator-annprocess</artifactId>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>copy-dependencies</id>
+ <phase>prepare-package</phase>
+ <goals>
+ <goal>copy-dependencies</goal>
+ </goals>
+ <configuration>
+ <outputDirectory>
+ ${project.build.directory}/libs
+ </outputDirectory>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <configuration>
+ <archive>
+ <manifest>
+ <addClasspath>true</addClasspath>
+ <classpathPrefix>libs/</classpathPrefix>
+ <mainClass>org.apache.dubbo.benchmark.Client</mainClass>
+ </manifest>
+ </archive>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
\ No newline at end of file
diff --git a/dubbo-kryo-client/src/main/java/org/apache/dubbo/benchmark/Client.java b/dubbo-kryo-client/src/main/java/org/apache/dubbo/benchmark/Client.java
new file mode 100644
index 0000000..08fe221
--- /dev/null
+++ b/dubbo-kryo-client/src/main/java/org/apache/dubbo/benchmark/Client.java
@@ -0,0 +1,95 @@
+package org.apache.dubbo.benchmark;
+
+import com.alibaba.dubbo.config.ProtocolConfig;
+import org.apache.dubbo.benchmark.bean.Page;
+import org.apache.dubbo.benchmark.bean.User;
+import org.apache.dubbo.benchmark.rpc.AbstractClient;
+import org.apache.dubbo.benchmark.service.UserService;
+import org.openjdk.jmh.annotations.Benchmark;
+import org.openjdk.jmh.annotations.BenchmarkMode;
+import org.openjdk.jmh.annotations.Mode;
+import org.openjdk.jmh.annotations.OutputTimeUnit;
+import org.openjdk.jmh.annotations.Scope;
+import org.openjdk.jmh.annotations.State;
+import org.openjdk.jmh.annotations.TearDown;
+import org.openjdk.jmh.results.format.ResultFormatType;
+import org.openjdk.jmh.runner.Runner;
+import org.openjdk.jmh.runner.options.Options;
+import org.openjdk.jmh.runner.options.OptionsBuilder;
+import org.openjdk.jmh.runner.options.TimeValue;
+import org.springframework.context.support.ClassPathXmlApplicationContext;
+
+import java.io.IOException;
+import java.util.concurrent.TimeUnit;
+
+@State(Scope.Benchmark)
+public class Client extends AbstractClient {
+ private static final int CONCURRENCY = 32;
+
+ private final ClassPathXmlApplicationContext context;
+ private final UserService userService;
+
+ public Client() {
+ context = new ClassPathXmlApplicationContext("consumer.xml");
+ context.start();
+ userService = (UserService) context.getBean("userService");
+ }
+
+ @Override
+ protected UserService getUserService() {
+ return userService;
+ }
+
+ @TearDown
+ public void close() throws IOException {
+ context.close();
+ ProtocolConfig.destroyAll();
+ }
+
+ @Benchmark
+ @BenchmarkMode({Mode.Throughput, Mode.AverageTime, Mode.SampleTime})
+ @OutputTimeUnit(TimeUnit.MILLISECONDS)
+ @Override
+ public boolean existUser() throws Exception {
+ return super.existUser();
+ }
+
+ @Benchmark
+ @BenchmarkMode({Mode.Throughput, Mode.AverageTime, Mode.SampleTime})
+ @OutputTimeUnit(TimeUnit.MILLISECONDS)
+ @Override
+ public boolean createUser() throws Exception {
+ return super.createUser();
+ }
+
+ @Benchmark
+ @BenchmarkMode({Mode.Throughput, Mode.AverageTime, Mode.SampleTime})
+ @OutputTimeUnit(TimeUnit.MILLISECONDS)
+ @Override
+ public User getUser() throws Exception {
+ return super.getUser();
+ }
+
+ @Benchmark
+ @BenchmarkMode({Mode.Throughput, Mode.AverageTime, Mode.SampleTime})
+ @OutputTimeUnit(TimeUnit.MILLISECONDS)
+ @Override
+ public Page<User> listUser() throws Exception {
+ return super.listUser();
+ }
+
+ public static void main(String[] args) throws Exception {
+ Options opt = new OptionsBuilder()
+ .include(Client.class.getSimpleName())
+ .warmupIterations(3)
+ .warmupTime(TimeValue.seconds(10))
+ .measurementIterations(3)
+ .measurementTime(TimeValue.seconds(10))
+ .threads(CONCURRENCY)
+ .resultFormat(ResultFormatType.JSON)
+ .forks(1)
+ .build();
+
+ new Runner(opt).run();
+ }
+}
diff --git a/dubbo-kryo-client/src/main/resources/benchmark.properties b/dubbo-kryo-client/src/main/resources/benchmark.properties
new file mode 100644
index 0000000..9d276bf
--- /dev/null
+++ b/dubbo-kryo-client/src/main/resources/benchmark.properties
@@ -0,0 +1,2 @@
+server.host=localhost
+server.port=8080
\ No newline at end of file
diff --git a/dubbo-kryo-client/src/main/resources/consumer.xml b/dubbo-kryo-client/src/main/resources/consumer.xml
new file mode 100644
index 0000000..22c89f9
--- /dev/null
+++ b/dubbo-kryo-client/src/main/resources/consumer.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:dubbo="http://code.alibabatech.com/schema/dubbo"
+ xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://code.alibabatech.com/schema/dubbo http://code.alibabatech.com/schema/dubbo/dubbo.xsd">
+ <dubbo:application name="dubbo-client-kyro"/>
+ <dubbo:reference id="userService" check="false"
+ interface="org.apache.dubbo.benchmark.service.UserService"
+ url="dubbo://localhost:8080?optimizer=org.apache.dubbo.benchmark.serialize.SerializationOptimizerImpl&serialization=kryo"/>
+ <dubbo:consumer client="netty4" filter="-default"/>
+</beans>
\ No newline at end of file
diff --git a/dubbo-kryo-client/src/main/resources/logback.xml b/dubbo-kryo-client/src/main/resources/logback.xml
new file mode 100644
index 0000000..cb8c9fd
--- /dev/null
+++ b/dubbo-kryo-client/src/main/resources/logback.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<configuration>
+ <jmxConfigurator/>
+
+ <appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
+ <encoder>
+ <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n
+ </pattern>
+ </encoder>
+ </appender>
+
+ <appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
+ <file>logs/dubbo-kyro-client.log</file>
+ <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
+ <fileNamePattern>logs/benchmark-rpc-client.%d{yyyy-MM-dd}.log.gz</fileNamePattern>
+ </rollingPolicy>
+ <encoder>
+ <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n </pattern>
+ </encoder>
+ </appender>
+
+ <logger name="benchmark.rpc" level="INFO"/>
+
+ <root level="INFO">
+ <appender-ref ref="CONSOLE" />
+ <appender-ref ref="FILE"/>
+ </root>
+</configuration>
diff --git a/dubbo-kryo-server/pom.xml b/dubbo-kryo-server/pom.xml
new file mode 100644
index 0000000..4d5f6bd
--- /dev/null
+++ b/dubbo-kryo-server/pom.xml
@@ -0,0 +1,99 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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/xsd/maven-4.0.0.xsd">
+ <parent>
+ <artifactId>dubbo-benchmark</artifactId>
+ <groupId>org.apache.dubbo</groupId>
+ <version>1.0-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+
+ <artifactId>dubbo-kryo-server</artifactId>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.dubbo</groupId>
+ <artifactId>benchmark-base</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>com.alibaba</groupId>
+ <artifactId>dubbo</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>io.netty</groupId>
+ <artifactId>netty-all</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>de.javakaffee</groupId>
+ <artifactId>kryo-serializers</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>com.esotericsoftware</groupId>
+ <artifactId>kryo</artifactId>
+ <version>${kryo.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.openjdk.jmh</groupId>
+ <artifactId>jmh-core</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.openjdk.jmh</groupId>
+ <artifactId>jmh-generator-annprocess</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>ch.qos.logback</groupId>
+ <artifactId>logback-classic</artifactId>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>copy-dependencies</id>
+ <phase>prepare-package</phase>
+ <goals>
+ <goal>copy-dependencies</goal>
+ </goals>
+ <configuration>
+ <outputDirectory>
+ ${project.build.directory}/libs
+ </outputDirectory>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <configuration>
+ <archive>
+ <manifest>
+ <addClasspath>true</addClasspath>
+ <classpathPrefix>libs/</classpathPrefix>
+ <mainClass>org.apache.dubbo.benchmark.Server</mainClass>
+ </manifest>
+ </archive>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
\ No newline at end of file
diff --git a/dubbo-kryo-server/src/main/java/org/apache/dubbo/benchmark/Server.java b/dubbo-kryo-server/src/main/java/org/apache/dubbo/benchmark/Server.java
new file mode 100644
index 0000000..6787d36
--- /dev/null
+++ b/dubbo-kryo-server/src/main/java/org/apache/dubbo/benchmark/Server.java
@@ -0,0 +1,14 @@
+package org.apache.dubbo.benchmark;
+
+import org.springframework.context.support.ClassPathXmlApplicationContext;
+
+public class Server {
+
+ public static void main(String[] args) throws InterruptedException {
+ try (ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("provider.xml")) {
+ context.start();
+ Thread.sleep(Integer.MAX_VALUE);
+ }
+ }
+
+}
diff --git a/dubbo-kryo-server/src/main/resources/benchmark.properties b/dubbo-kryo-server/src/main/resources/benchmark.properties
new file mode 100644
index 0000000..9d276bf
--- /dev/null
+++ b/dubbo-kryo-server/src/main/resources/benchmark.properties
@@ -0,0 +1,2 @@
+server.host=localhost
+server.port=8080
\ No newline at end of file
diff --git a/dubbo-kryo-server/src/main/resources/logback.xml b/dubbo-kryo-server/src/main/resources/logback.xml
new file mode 100644
index 0000000..3ba87e6
--- /dev/null
+++ b/dubbo-kryo-server/src/main/resources/logback.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<configuration>
+ <jmxConfigurator/>
+
+ <appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
+ <encoder>
+ <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n
+ </pattern>
+ </encoder>
+ </appender>
+
+ <appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
+ <file>logs/dubbo-kryo-server.log</file>
+ <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
+ <fileNamePattern>logs/benchmark-rpc-client.%d{yyyy-MM-dd}.log.gz</fileNamePattern>
+ </rollingPolicy>
+ <encoder>
+ <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n </pattern>
+ </encoder>
+ </appender>
+
+ <logger name="benchmark.rpc" level="INFO"/>
+
+ <root level="INFO">
+ <appender-ref ref="CONSOLE" />
+ <appender-ref ref="FILE"/>
+ </root>
+</configuration>
diff --git a/dubbo-kryo-server/src/main/resources/provider.xml b/dubbo-kryo-server/src/main/resources/provider.xml
new file mode 100644
index 0000000..3666e87
--- /dev/null
+++ b/dubbo-kryo-server/src/main/resources/provider.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:dubbo="http://code.alibabatech.com/schema/dubbo"
+ xmlns:context="http://www.springframework.org/schema/context"
+ xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://code.alibabatech.com/schema/dubbo http://code.alibabatech.com/schema/dubbo/dubbo.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">
+ <context:property-placeholder location="classpath:benchmark.properties" system-properties-mode="OVERRIDE"/>
+ <dubbo:application name="dubbo-server-kryo" />
+ <dubbo:protocol name="dubbo" host="${server.host}" server="netty4" port="${server.port}" serialization="kryo"
+ optimizer="org.apache.dubbo.benchmark.serialize.SerializationOptimizerImpl"/>
+ <dubbo:registry address="N/A"/>
+ <dubbo:service interface="org.apache.dubbo.benchmark.service.UserService" ref="userService" filter="-default"/>
+ <bean id="userService" class="org.apache.dubbo.benchmark.service.UserServiceServerImpl"/>
+</beans>
\ No newline at end of file
diff --git a/pom.xml b/pom.xml
new file mode 100644
index 0000000..20bea57
--- /dev/null
+++ b/pom.xml
@@ -0,0 +1,133 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>org.apache.dubbo</groupId>
+ <artifactId>dubbo-benchmark</artifactId>
+ <packaging>pom</packaging>
+ <version>1.0-SNAPSHOT</version>
+
+ <properties>
+ <java.source>1.8</java.source>
+ <java.target>1.8</java.target>
+ <dubbo.version>2.6.1</dubbo.version>
+ <netty.version>4.1.25.Final</netty.version>
+ <kryo.version>4.0.2</kryo.version>
+ <kryo-serializers.version>0.42</kryo-serializers.version>
+ <jmh.version>1.21</jmh.version>
+ <slf4j.version>1.7.25</slf4j.version>
+ <logback.version>1.2.3</logback.version>
+ <junit.version>4.12</junit.version>
+ </properties>
+
+ <modules>
+ <module>benchmark-base</module>
+ <module>dubbo-kryo-client</module>
+ <module>dubbo-kryo-server</module>
+ </modules>
+
+ <dependencies>
+ <dependency>
+ <groupId>com.alibaba</groupId>
+ <artifactId>dubbo</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>io.netty</groupId>
+ <artifactId>netty-all</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>ch.qos.logback</groupId>
+ <artifactId>logback-classic</artifactId>
+ </dependency>
+ </dependencies>
+
+ <dependencyManagement>
+ <dependencies>
+ <!-- use netty 4 by default -->
+ <dependency>
+ <groupId>com.alibaba</groupId>
+ <artifactId>dubbo</artifactId>
+ <version>${dubbo.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.jboss.netty</groupId>
+ <artifactId>netty</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ <dependency>
+ <groupId>io.netty</groupId>
+ <artifactId>netty-all</artifactId>
+ <version>${netty.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>de.javakaffee</groupId>
+ <artifactId>kryo-serializers</artifactId>
+ <version>${kryo-serializers.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>com.esotericsoftware</groupId>
+ <artifactId>kryo</artifactId>
+ <version>${kryo.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.openjdk.jmh</groupId>
+ <artifactId>jmh-core</artifactId>
+ <version>${jmh.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.openjdk.jmh</groupId>
+ <artifactId>jmh-generator-annprocess</artifactId>
+ <version>${jmh.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>${junit.version}</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ <version>${slf4j.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>ch.qos.logback</groupId>
+ <artifactId>logback-classic</artifactId>
+ <version>${logback.version}</version>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>3.7.0</version>
+ <configuration>
+ <source>${java.source}</source>
+ <target>${java.target}</target>
+ <encoding>UTF-8</encoding>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
\ No newline at end of file