添加Sample功能

This commit is contained in:
ascrutae 2016-07-28 13:46:15 +08:00
parent 00a5cb9aeb
commit 2158fd0cbe
56 changed files with 3265 additions and 1 deletions

View File

@ -8,6 +8,7 @@
<version>1.0-Final</version>
<modules>
<module>samples/skywalking-auth</module>
<module>samples/skywalking-example</module>
<module>skywalking-collector</module>
<module>skywalking-server</module>
<module>skywalking-alarm</module>
@ -61,4 +62,4 @@
<url>https://api.bintray.com/maven/wu-sheng/skywalking/com.ai.cloud.skywalking/;publish=1</url>
</repository>
</distributionManagement>
</project>
</project>

View File

@ -0,0 +1,98 @@
<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>example-dubbo</artifactId>
<groupId>com.ai.cloud</groupId>
<version>1.0-Final</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>dubbo-impl</artifactId>
<packaging>jar</packaging>
<name>dubbo-impl</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>com.ai.cloud</groupId>
<artifactId>dubbo-interfaces</artifactId>
<version>1.0-Final</version>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>dubbox</artifactId>
<version>2.8.4</version>
</dependency>
<dependency>
<groupId>org.javassist</groupId>
<artifactId>javassist</artifactId>
<version>3.18.1-GA</version>
</dependency>
<dependency>
<groupId>com.101tec</groupId>
<artifactId>zkclient</artifactId>
<version>0.7</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
<version>4.3.1.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-tx</artifactId>
<version>4.3.1.RELEASE</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.6.2</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>
<version>4.3.1.RELEASE</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-dbcp2</artifactId>
<version>2.1.1</version>
</dependency>
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis-spring</artifactId>
<version>1.3.0</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>4.3.1.RELEASE</version>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<version>1.4.192</version>
</dependency>
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis</artifactId>
<version>3.4.1</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>RELEASE</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.ai.cloud</groupId>
<artifactId>skywalking-log4j-1.x-plugin</artifactId>
<version>1.0-Final</version>
</dependency>
</dependencies>
</project>

View File

@ -0,0 +1,22 @@
package com.ai.cloud.skywalking.sample.dubbo.impl;
import com.ai.cloud.skywalking.sample.dubbo.interfaces.SampleDubboInterface;
import com.ai.cloud.skywalking.sample.service.inter.SampleServiceInterface;
import com.alibaba.dubbo.config.annotation.Service;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
@Service
public class SampleDubboInterfaceImpl implements SampleDubboInterface {
private Logger logger = LogManager.getLogger(SampleDubboInterfaceImpl.class);
@Autowired
private SampleServiceInterface sampleServiceInterface;
public String callMethodByDubbox(String value) {
logger.info("Begin to call service method.");
return sampleServiceInterface.saveSampleTable1(value);
}
}

View File

@ -0,0 +1,98 @@
package com.ai.cloud.skywalking.sample.mybatis.dao;
import com.ai.cloud.skywalking.sample.mybatis.model.Sampletable1;
import com.ai.cloud.skywalking.sample.mybatis.model.Sampletable1Example;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface Sampletable1Mapper {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table PUBLIC.SAMPLETABLE1
*
* @mbggenerated Sun Jul 24 09:19:30 CST 2016
*/
int countByExample(Sampletable1Example example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table PUBLIC.SAMPLETABLE1
*
* @mbggenerated Sun Jul 24 09:19:30 CST 2016
*/
int deleteByExample(Sampletable1Example example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table PUBLIC.SAMPLETABLE1
*
* @mbggenerated Sun Jul 24 09:19:30 CST 2016
*/
int deleteByPrimaryKey(String key1);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table PUBLIC.SAMPLETABLE1
*
* @mbggenerated Sun Jul 24 09:19:30 CST 2016
*/
int insert(Sampletable1 record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table PUBLIC.SAMPLETABLE1
*
* @mbggenerated Sun Jul 24 09:19:30 CST 2016
*/
int insertSelective(Sampletable1 record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table PUBLIC.SAMPLETABLE1
*
* @mbggenerated Sun Jul 24 09:19:30 CST 2016
*/
List<Sampletable1> selectByExample(Sampletable1Example example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table PUBLIC.SAMPLETABLE1
*
* @mbggenerated Sun Jul 24 09:19:30 CST 2016
*/
Sampletable1 selectByPrimaryKey(String key1);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table PUBLIC.SAMPLETABLE1
*
* @mbggenerated Sun Jul 24 09:19:30 CST 2016
*/
int updateByExampleSelective(@Param("record") Sampletable1 record, @Param("example") Sampletable1Example example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table PUBLIC.SAMPLETABLE1
*
* @mbggenerated Sun Jul 24 09:19:30 CST 2016
*/
int updateByExample(@Param("record") Sampletable1 record, @Param("example") Sampletable1Example example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table PUBLIC.SAMPLETABLE1
*
* @mbggenerated Sun Jul 24 09:19:30 CST 2016
*/
int updateByPrimaryKeySelective(Sampletable1 record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table PUBLIC.SAMPLETABLE1
*
* @mbggenerated Sun Jul 24 09:19:30 CST 2016
*/
int updateByPrimaryKey(Sampletable1 record);
}

View File

@ -0,0 +1,98 @@
package com.ai.cloud.skywalking.sample.mybatis.dao;
import java.util.List;
import com.ai.cloud.skywalking.sample.mybatis.model.Sampletable2;
import com.ai.cloud.skywalking.sample.mybatis.model.Sampletable2Example;
import org.apache.ibatis.annotations.Param;
public interface Sampletable2Mapper {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table PUBLIC.SAMPLETABLE2
*
* @mbggenerated Sun Jul 24 09:26:38 CST 2016
*/
int countByExample(Sampletable2Example example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table PUBLIC.SAMPLETABLE2
*
* @mbggenerated Sun Jul 24 09:26:38 CST 2016
*/
int deleteByExample(Sampletable2Example example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table PUBLIC.SAMPLETABLE2
*
* @mbggenerated Sun Jul 24 09:26:38 CST 2016
*/
int deleteByPrimaryKey(String key2);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table PUBLIC.SAMPLETABLE2
*
* @mbggenerated Sun Jul 24 09:26:38 CST 2016
*/
int insert(Sampletable2 record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table PUBLIC.SAMPLETABLE2
*
* @mbggenerated Sun Jul 24 09:26:38 CST 2016
*/
int insertSelective(Sampletable2 record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table PUBLIC.SAMPLETABLE2
*
* @mbggenerated Sun Jul 24 09:26:38 CST 2016
*/
List<Sampletable2> selectByExample(Sampletable2Example example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table PUBLIC.SAMPLETABLE2
*
* @mbggenerated Sun Jul 24 09:26:38 CST 2016
*/
Sampletable2 selectByPrimaryKey(String key2);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table PUBLIC.SAMPLETABLE2
*
* @mbggenerated Sun Jul 24 09:26:38 CST 2016
*/
int updateByExampleSelective(@Param("record") Sampletable2 record, @Param("example") Sampletable2Example example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table PUBLIC.SAMPLETABLE2
*
* @mbggenerated Sun Jul 24 09:26:38 CST 2016
*/
int updateByExample(@Param("record") Sampletable2 record, @Param("example") Sampletable2Example example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table PUBLIC.SAMPLETABLE2
*
* @mbggenerated Sun Jul 24 09:26:38 CST 2016
*/
int updateByPrimaryKeySelective(Sampletable2 record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table PUBLIC.SAMPLETABLE2
*
* @mbggenerated Sun Jul 24 09:26:38 CST 2016
*/
int updateByPrimaryKey(Sampletable2 record);
}

View File

@ -0,0 +1,63 @@
package com.ai.cloud.skywalking.sample.mybatis.model;
public class Sampletable1 {
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column PUBLIC.SAMPLETABLE1.KEY1
*
* @mbggenerated Sun Jul 24 09:19:30 CST 2016
*/
private String key1;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column PUBLIC.SAMPLETABLE1.VALUE1
*
* @mbggenerated Sun Jul 24 09:19:30 CST 2016
*/
private String value1;
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column PUBLIC.SAMPLETABLE1.KEY1
*
* @return the value of PUBLIC.SAMPLETABLE1.KEY1
* @mbggenerated Sun Jul 24 09:19:30 CST 2016
*/
public String getKey1() {
return key1;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column PUBLIC.SAMPLETABLE1.KEY1
*
* @param key1 the value for PUBLIC.SAMPLETABLE1.KEY1
* @mbggenerated Sun Jul 24 09:19:30 CST 2016
*/
public void setKey1(String key1) {
this.key1 = key1 == null ? null : key1.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column PUBLIC.SAMPLETABLE1.VALUE1
*
* @return the value of PUBLIC.SAMPLETABLE1.VALUE1
* @mbggenerated Sun Jul 24 09:19:30 CST 2016
*/
public String getValue1() {
return value1;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column PUBLIC.SAMPLETABLE1.VALUE1
*
* @param value1 the value for PUBLIC.SAMPLETABLE1.VALUE1
* @mbggenerated Sun Jul 24 09:19:30 CST 2016
*/
public void setValue1(String value1) {
this.value1 = value1 == null ? null : value1.trim();
}
}

View File

@ -0,0 +1,442 @@
package com.ai.cloud.skywalking.sample.mybatis.model;
import java.util.ArrayList;
import java.util.List;
public class Sampletable1Example {
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table PUBLIC.SAMPLETABLE1
*
* @mbggenerated Sun Jul 24 09:19:30 CST 2016
*/
protected String orderByClause;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table PUBLIC.SAMPLETABLE1
*
* @mbggenerated Sun Jul 24 09:19:30 CST 2016
*/
protected boolean distinct;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table PUBLIC.SAMPLETABLE1
*
* @mbggenerated Sun Jul 24 09:19:30 CST 2016
*/
protected List<Criteria> oredCriteria;
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table PUBLIC.SAMPLETABLE1
*
* @mbggenerated Sun Jul 24 09:19:30 CST 2016
*/
public Sampletable1Example() {
oredCriteria = new ArrayList<Criteria>();
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table PUBLIC.SAMPLETABLE1
*
* @mbggenerated Sun Jul 24 09:19:30 CST 2016
*/
public void setOrderByClause(String orderByClause) {
this.orderByClause = orderByClause;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table PUBLIC.SAMPLETABLE1
*
* @mbggenerated Sun Jul 24 09:19:30 CST 2016
*/
public String getOrderByClause() {
return orderByClause;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table PUBLIC.SAMPLETABLE1
*
* @mbggenerated Sun Jul 24 09:19:30 CST 2016
*/
public void setDistinct(boolean distinct) {
this.distinct = distinct;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table PUBLIC.SAMPLETABLE1
*
* @mbggenerated Sun Jul 24 09:19:30 CST 2016
*/
public boolean isDistinct() {
return distinct;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table PUBLIC.SAMPLETABLE1
*
* @mbggenerated Sun Jul 24 09:19:30 CST 2016
*/
public List<Criteria> getOredCriteria() {
return oredCriteria;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table PUBLIC.SAMPLETABLE1
*
* @mbggenerated Sun Jul 24 09:19:30 CST 2016
*/
public void or(Criteria criteria) {
oredCriteria.add(criteria);
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table PUBLIC.SAMPLETABLE1
*
* @mbggenerated Sun Jul 24 09:19:30 CST 2016
*/
public Criteria or() {
Criteria criteria = createCriteriaInternal();
oredCriteria.add(criteria);
return criteria;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table PUBLIC.SAMPLETABLE1
*
* @mbggenerated Sun Jul 24 09:19:30 CST 2016
*/
public Criteria createCriteria() {
Criteria criteria = createCriteriaInternal();
if (oredCriteria.size() == 0) {
oredCriteria.add(criteria);
}
return criteria;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table PUBLIC.SAMPLETABLE1
*
* @mbggenerated Sun Jul 24 09:19:30 CST 2016
*/
protected Criteria createCriteriaInternal() {
Criteria criteria = new Criteria();
return criteria;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table PUBLIC.SAMPLETABLE1
*
* @mbggenerated Sun Jul 24 09:19:30 CST 2016
*/
public void clear() {
oredCriteria.clear();
orderByClause = null;
distinct = false;
}
/**
* This class was generated by MyBatis Generator.
* This class corresponds to the database table PUBLIC.SAMPLETABLE1
*
* @mbggenerated Sun Jul 24 09:19:30 CST 2016
*/
protected abstract static class GeneratedCriteria {
protected List<Criterion> criteria;
protected GeneratedCriteria() {
super();
criteria = new ArrayList<Criterion>();
}
public boolean isValid() {
return criteria.size() > 0;
}
public List<Criterion> getAllCriteria() {
return criteria;
}
public List<Criterion> getCriteria() {
return criteria;
}
protected void addCriterion(String condition) {
if (condition == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion(condition));
}
protected void addCriterion(String condition, Object value, String property) {
if (value == null) {
throw new RuntimeException("Value for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value));
}
protected void addCriterion(String condition, Object value1, Object value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value1, value2));
}
public Criteria andKey1IsNull() {
addCriterion("KEY1 is null");
return (Criteria) this;
}
public Criteria andKey1IsNotNull() {
addCriterion("KEY1 is not null");
return (Criteria) this;
}
public Criteria andKey1EqualTo(String value) {
addCriterion("KEY1 =", value, "key1");
return (Criteria) this;
}
public Criteria andKey1NotEqualTo(String value) {
addCriterion("KEY1 <>", value, "key1");
return (Criteria) this;
}
public Criteria andKey1GreaterThan(String value) {
addCriterion("KEY1 >", value, "key1");
return (Criteria) this;
}
public Criteria andKey1GreaterThanOrEqualTo(String value) {
addCriterion("KEY1 >=", value, "key1");
return (Criteria) this;
}
public Criteria andKey1LessThan(String value) {
addCriterion("KEY1 <", value, "key1");
return (Criteria) this;
}
public Criteria andKey1LessThanOrEqualTo(String value) {
addCriterion("KEY1 <=", value, "key1");
return (Criteria) this;
}
public Criteria andKey1Like(String value) {
addCriterion("KEY1 like", value, "key1");
return (Criteria) this;
}
public Criteria andKey1NotLike(String value) {
addCriterion("KEY1 not like", value, "key1");
return (Criteria) this;
}
public Criteria andKey1In(List<String> values) {
addCriterion("KEY1 in", values, "key1");
return (Criteria) this;
}
public Criteria andKey1NotIn(List<String> values) {
addCriterion("KEY1 not in", values, "key1");
return (Criteria) this;
}
public Criteria andKey1Between(String value1, String value2) {
addCriterion("KEY1 between", value1, value2, "key1");
return (Criteria) this;
}
public Criteria andKey1NotBetween(String value1, String value2) {
addCriterion("KEY1 not between", value1, value2, "key1");
return (Criteria) this;
}
public Criteria andValue1IsNull() {
addCriterion("VALUE1 is null");
return (Criteria) this;
}
public Criteria andValue1IsNotNull() {
addCriterion("VALUE1 is not null");
return (Criteria) this;
}
public Criteria andValue1EqualTo(String value) {
addCriterion("VALUE1 =", value, "value1");
return (Criteria) this;
}
public Criteria andValue1NotEqualTo(String value) {
addCriterion("VALUE1 <>", value, "value1");
return (Criteria) this;
}
public Criteria andValue1GreaterThan(String value) {
addCriterion("VALUE1 >", value, "value1");
return (Criteria) this;
}
public Criteria andValue1GreaterThanOrEqualTo(String value) {
addCriterion("VALUE1 >=", value, "value1");
return (Criteria) this;
}
public Criteria andValue1LessThan(String value) {
addCriterion("VALUE1 <", value, "value1");
return (Criteria) this;
}
public Criteria andValue1LessThanOrEqualTo(String value) {
addCriterion("VALUE1 <=", value, "value1");
return (Criteria) this;
}
public Criteria andValue1Like(String value) {
addCriterion("VALUE1 like", value, "value1");
return (Criteria) this;
}
public Criteria andValue1NotLike(String value) {
addCriterion("VALUE1 not like", value, "value1");
return (Criteria) this;
}
public Criteria andValue1In(List<String> values) {
addCriterion("VALUE1 in", values, "value1");
return (Criteria) this;
}
public Criteria andValue1NotIn(List<String> values) {
addCriterion("VALUE1 not in", values, "value1");
return (Criteria) this;
}
public Criteria andValue1Between(String value1, String value2) {
addCriterion("VALUE1 between", value1, value2, "value1");
return (Criteria) this;
}
public Criteria andValue1NotBetween(String value1, String value2) {
addCriterion("VALUE1 not between", value1, value2, "value1");
return (Criteria) this;
}
}
/**
* This class was generated by MyBatis Generator.
* This class corresponds to the database table PUBLIC.SAMPLETABLE1
*
* @mbggenerated do_not_delete_during_merge Sun Jul 24 09:19:30 CST 2016
*/
public static class Criteria extends GeneratedCriteria {
protected Criteria() {
super();
}
}
/**
* This class was generated by MyBatis Generator.
* This class corresponds to the database table PUBLIC.SAMPLETABLE1
*
* @mbggenerated Sun Jul 24 09:19:30 CST 2016
*/
public static class Criterion {
private String condition;
private Object value;
private Object secondValue;
private boolean noValue;
private boolean singleValue;
private boolean betweenValue;
private boolean listValue;
private String typeHandler;
public String getCondition() {
return condition;
}
public Object getValue() {
return value;
}
public Object getSecondValue() {
return secondValue;
}
public boolean isNoValue() {
return noValue;
}
public boolean isSingleValue() {
return singleValue;
}
public boolean isBetweenValue() {
return betweenValue;
}
public boolean isListValue() {
return listValue;
}
public String getTypeHandler() {
return typeHandler;
}
protected Criterion(String condition) {
super();
this.condition = condition;
this.typeHandler = null;
this.noValue = true;
}
protected Criterion(String condition, Object value, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.typeHandler = typeHandler;
if (value instanceof List<?>) {
this.listValue = true;
} else {
this.singleValue = true;
}
}
protected Criterion(String condition, Object value) {
this(condition, value, null);
}
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.secondValue = secondValue;
this.typeHandler = typeHandler;
this.betweenValue = true;
}
protected Criterion(String condition, Object value, Object secondValue) {
this(condition, value, secondValue, null);
}
}
}

View File

@ -0,0 +1,69 @@
package com.ai.cloud.skywalking.sample.mybatis.model;
public class Sampletable2 {
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column PUBLIC.SAMPLETABLE2.KEY2
*
* @mbggenerated Sun Jul 24 09:26:38 CST 2016
*/
private String key2;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column PUBLIC.SAMPLETABLE2.VALUE2
*
* @mbggenerated Sun Jul 24 09:26:38 CST 2016
*/
private String value2;
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column PUBLIC.SAMPLETABLE2.KEY2
*
* @return the value of PUBLIC.SAMPLETABLE2.KEY2
*
* @mbggenerated Sun Jul 24 09:26:38 CST 2016
*/
public String getKey2() {
return key2;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column PUBLIC.SAMPLETABLE2.KEY2
*
* @param key2 the value for PUBLIC.SAMPLETABLE2.KEY2
*
* @mbggenerated Sun Jul 24 09:26:38 CST 2016
*/
public void setKey2(String key2) {
this.key2 = key2 == null ? null : key2.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column PUBLIC.SAMPLETABLE2.VALUE2
*
* @return the value of PUBLIC.SAMPLETABLE2.VALUE2
*
* @mbggenerated Sun Jul 24 09:26:38 CST 2016
*/
public String getValue2() {
return value2;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column PUBLIC.SAMPLETABLE2.VALUE2
*
* @param value2 the value for PUBLIC.SAMPLETABLE2.VALUE2
*
* @mbggenerated Sun Jul 24 09:26:38 CST 2016
*/
public void setValue2(String value2) {
this.value2 = value2 == null ? null : value2.trim();
}
}

View File

@ -0,0 +1,443 @@
package com.ai.cloud.skywalking.sample.mybatis.model;
import java.util.ArrayList;
import java.util.List;
public class Sampletable2Example {
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table PUBLIC.SAMPLETABLE2
*
* @mbggenerated Sun Jul 24 09:26:38 CST 2016
*/
protected String orderByClause;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table PUBLIC.SAMPLETABLE2
*
* @mbggenerated Sun Jul 24 09:26:38 CST 2016
*/
protected boolean distinct;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table PUBLIC.SAMPLETABLE2
*
* @mbggenerated Sun Jul 24 09:26:38 CST 2016
*/
protected List<Criteria> oredCriteria;
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table PUBLIC.SAMPLETABLE2
*
* @mbggenerated Sun Jul 24 09:26:38 CST 2016
*/
public Sampletable2Example() {
oredCriteria = new ArrayList<Criteria>();
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table PUBLIC.SAMPLETABLE2
*
* @mbggenerated Sun Jul 24 09:26:38 CST 2016
*/
public void setOrderByClause(String orderByClause) {
this.orderByClause = orderByClause;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table PUBLIC.SAMPLETABLE2
*
* @mbggenerated Sun Jul 24 09:26:38 CST 2016
*/
public String getOrderByClause() {
return orderByClause;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table PUBLIC.SAMPLETABLE2
*
* @mbggenerated Sun Jul 24 09:26:38 CST 2016
*/
public void setDistinct(boolean distinct) {
this.distinct = distinct;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table PUBLIC.SAMPLETABLE2
*
* @mbggenerated Sun Jul 24 09:26:38 CST 2016
*/
public boolean isDistinct() {
return distinct;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table PUBLIC.SAMPLETABLE2
*
* @mbggenerated Sun Jul 24 09:26:38 CST 2016
*/
public List<Criteria> getOredCriteria() {
return oredCriteria;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table PUBLIC.SAMPLETABLE2
*
* @mbggenerated Sun Jul 24 09:26:38 CST 2016
*/
public void or(Criteria criteria) {
oredCriteria.add(criteria);
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table PUBLIC.SAMPLETABLE2
*
* @mbggenerated Sun Jul 24 09:26:38 CST 2016
*/
public Criteria or() {
Criteria criteria = createCriteriaInternal();
oredCriteria.add(criteria);
return criteria;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table PUBLIC.SAMPLETABLE2
*
* @mbggenerated Sun Jul 24 09:26:38 CST 2016
*/
public Criteria createCriteria() {
Criteria criteria = createCriteriaInternal();
if (oredCriteria.size() == 0) {
oredCriteria.add(criteria);
}
return criteria;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table PUBLIC.SAMPLETABLE2
*
* @mbggenerated Sun Jul 24 09:26:38 CST 2016
*/
protected Criteria createCriteriaInternal() {
Criteria criteria = new Criteria();
return criteria;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table PUBLIC.SAMPLETABLE2
*
* @mbggenerated Sun Jul 24 09:26:38 CST 2016
*/
public void clear() {
oredCriteria.clear();
orderByClause = null;
distinct = false;
}
/**
* This class was generated by MyBatis Generator.
* This class corresponds to the database table PUBLIC.SAMPLETABLE2
*
* @mbggenerated Sun Jul 24 09:26:38 CST 2016
*/
protected abstract static class GeneratedCriteria {
protected List<Criterion> criteria;
protected GeneratedCriteria() {
super();
criteria = new ArrayList<Criterion>();
}
public boolean isValid() {
return criteria.size() > 0;
}
public List<Criterion> getAllCriteria() {
return criteria;
}
public List<Criterion> getCriteria() {
return criteria;
}
protected void addCriterion(String condition) {
if (condition == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion(condition));
}
protected void addCriterion(String condition, Object value, String property) {
if (value == null) {
throw new RuntimeException("Value for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value));
}
protected void addCriterion(String condition, Object value1, Object value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value1, value2));
}
public Criteria andKey2IsNull() {
addCriterion("KEY2 is null");
return (Criteria) this;
}
public Criteria andKey2IsNotNull() {
addCriterion("KEY2 is not null");
return (Criteria) this;
}
public Criteria andKey2EqualTo(String value) {
addCriterion("KEY2 =", value, "key2");
return (Criteria) this;
}
public Criteria andKey2NotEqualTo(String value) {
addCriterion("KEY2 <>", value, "key2");
return (Criteria) this;
}
public Criteria andKey2GreaterThan(String value) {
addCriterion("KEY2 >", value, "key2");
return (Criteria) this;
}
public Criteria andKey2GreaterThanOrEqualTo(String value) {
addCriterion("KEY2 >=", value, "key2");
return (Criteria) this;
}
public Criteria andKey2LessThan(String value) {
addCriterion("KEY2 <", value, "key2");
return (Criteria) this;
}
public Criteria andKey2LessThanOrEqualTo(String value) {
addCriterion("KEY2 <=", value, "key2");
return (Criteria) this;
}
public Criteria andKey2Like(String value) {
addCriterion("KEY2 like", value, "key2");
return (Criteria) this;
}
public Criteria andKey2NotLike(String value) {
addCriterion("KEY2 not like", value, "key2");
return (Criteria) this;
}
public Criteria andKey2In(List<String> values) {
addCriterion("KEY2 in", values, "key2");
return (Criteria) this;
}
public Criteria andKey2NotIn(List<String> values) {
addCriterion("KEY2 not in", values, "key2");
return (Criteria) this;
}
public Criteria andKey2Between(String value1, String value2) {
addCriterion("KEY2 between", value1, value2, "key2");
return (Criteria) this;
}
public Criteria andKey2NotBetween(String value1, String value2) {
addCriterion("KEY2 not between", value1, value2, "key2");
return (Criteria) this;
}
public Criteria andValue2IsNull() {
addCriterion("VALUE2 is null");
return (Criteria) this;
}
public Criteria andValue2IsNotNull() {
addCriterion("VALUE2 is not null");
return (Criteria) this;
}
public Criteria andValue2EqualTo(String value) {
addCriterion("VALUE2 =", value, "value2");
return (Criteria) this;
}
public Criteria andValue2NotEqualTo(String value) {
addCriterion("VALUE2 <>", value, "value2");
return (Criteria) this;
}
public Criteria andValue2GreaterThan(String value) {
addCriterion("VALUE2 >", value, "value2");
return (Criteria) this;
}
public Criteria andValue2GreaterThanOrEqualTo(String value) {
addCriterion("VALUE2 >=", value, "value2");
return (Criteria) this;
}
public Criteria andValue2LessThan(String value) {
addCriterion("VALUE2 <", value, "value2");
return (Criteria) this;
}
public Criteria andValue2LessThanOrEqualTo(String value) {
addCriterion("VALUE2 <=", value, "value2");
return (Criteria) this;
}
public Criteria andValue2Like(String value) {
addCriterion("VALUE2 like", value, "value2");
return (Criteria) this;
}
public Criteria andValue2NotLike(String value) {
addCriterion("VALUE2 not like", value, "value2");
return (Criteria) this;
}
public Criteria andValue2In(List<String> values) {
addCriterion("VALUE2 in", values, "value2");
return (Criteria) this;
}
public Criteria andValue2NotIn(List<String> values) {
addCriterion("VALUE2 not in", values, "value2");
return (Criteria) this;
}
public Criteria andValue2Between(String value1, String value2) {
addCriterion("VALUE2 between", value1, value2, "value2");
return (Criteria) this;
}
public Criteria andValue2NotBetween(String value1, String value2) {
addCriterion("VALUE2 not between", value1, value2, "value2");
return (Criteria) this;
}
}
/**
* This class was generated by MyBatis Generator.
* This class corresponds to the database table PUBLIC.SAMPLETABLE2
*
* @mbggenerated do_not_delete_during_merge Sun Jul 24 09:26:38 CST 2016
*/
public static class Criteria extends GeneratedCriteria {
protected Criteria() {
super();
}
}
/**
* This class was generated by MyBatis Generator.
* This class corresponds to the database table PUBLIC.SAMPLETABLE2
*
* @mbggenerated Sun Jul 24 09:26:38 CST 2016
*/
public static class Criterion {
private String condition;
private Object value;
private Object secondValue;
private boolean noValue;
private boolean singleValue;
private boolean betweenValue;
private boolean listValue;
private String typeHandler;
public String getCondition() {
return condition;
}
public Object getValue() {
return value;
}
public Object getSecondValue() {
return secondValue;
}
public boolean isNoValue() {
return noValue;
}
public boolean isSingleValue() {
return singleValue;
}
public boolean isBetweenValue() {
return betweenValue;
}
public boolean isListValue() {
return listValue;
}
public String getTypeHandler() {
return typeHandler;
}
protected Criterion(String condition) {
super();
this.condition = condition;
this.typeHandler = null;
this.noValue = true;
}
protected Criterion(String condition, Object value, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.typeHandler = typeHandler;
if (value instanceof List<?>) {
this.listValue = true;
} else {
this.singleValue = true;
}
}
protected Criterion(String condition, Object value) {
this(condition, value, null);
}
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.secondValue = secondValue;
this.typeHandler = typeHandler;
this.betweenValue = true;
}
protected Criterion(String condition, Object value, Object secondValue) {
this(condition, value, secondValue, null);
}
}
}

View File

@ -0,0 +1,51 @@
package com.ai.cloud.skywalking.sample.service.impl;
import com.ai.cloud.skywalking.sample.mybatis.dao.Sampletable1Mapper;
import com.ai.cloud.skywalking.sample.mybatis.dao.Sampletable2Mapper;
import com.ai.cloud.skywalking.sample.mybatis.model.Sampletable1;
import com.ai.cloud.skywalking.sample.mybatis.model.Sampletable2;
import com.ai.cloud.skywalking.sample.service.inter.SampleServiceInterface;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.UUID;
@Transactional
@Service
public class SampleServiceImpl implements SampleServiceInterface {
private Logger logger = LogManager.getLogger(SampleServiceImpl.class);
@Autowired
private Sampletable1Mapper sampletable1Mapper;
@Autowired
private Sampletable2Mapper sampletable2Mapper;
public String saveSampleTable1(String value) {
String generateKey = UUID.randomUUID().toString();
logger.info("Generate key : {}.", generateKey);
logger.info("Save to sampletable1");
sampletable1Mapper.insert(generateSampleObject1(generateKey,value));
logger.info("Save to sampletable2");
sampletable2Mapper.insert(generateSampleObject2(generateKey,value));
return generateKey;
}
private Sampletable2 generateSampleObject2(String generateKey, String value) {
Sampletable2 sampletable2 = new Sampletable2();
sampletable2.setKey2(generateKey);
sampletable2.setValue2(value);
return sampletable2;
}
private Sampletable1 generateSampleObject1(String generateKey, String value) {
Sampletable1 sampletable1 = new Sampletable1();
sampletable1.setKey1(generateKey);
sampletable1.setValue1(value);
return sampletable1;
}
}

View File

@ -0,0 +1,6 @@
package com.ai.cloud.skywalking.sample.service.inter;
public interface SampleServiceInterface {
String saveSampleTable1(String value);
}

View File

@ -0,0 +1,19 @@
package com.ai.cloud.skywalking.sample.util;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.context.support.ClassPathXmlApplicationContext;
public class DubboStart {
private static Logger logger = LogManager.getLogger(DubboStart.class);
public static void main(String[] args) throws InterruptedException {
ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("classpath*:spring-context.xml");
context.start();
logger.info("Dubbo started success.");
while (true){
Thread.sleep(60 * 60 * 1000);
}
}
}

View File

@ -0,0 +1,11 @@
CREATE TABLE PUBLIC.sampletable1
(
key1 VARCHAR2(36) PRIMARY KEY,
value1 VARCHAR2(36) NOT NULL
);
CREATE TABLE PUBLIC.sampletable2
(
key2 VARCHAR2(36) PRIMARY KEY,
value2 VARCHAR2(36) NOT NULL
);

View File

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
<log4j:configuration>
<appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
<layout class="com.ai.cloud.skywalking.plugin.log.log4j.v1.x.TraceIdPatternLayout">
<param name="ConversionPattern"
value="%x %d - %c -%-4r [%t] %-5p %x - %m%n" />
</layout>
</appender>
<root>
<priority value="debug" />
<appender-ref ref="CONSOLE" />
</root>
</log4j:configuration>

View File

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="debug">
<Appenders>
<Console name="Console" target="SYSTEM_OUT">
<PatternLayout pattern="%d - %c -%-4r [%t] %-5p %x - %m%n"/>
</Console>
</Appenders>
<Loggers>
<Root level="debug">
<AppenderRef ref="Console"/>
</Root>
</Loggers>
</Configuration>

View File

@ -0,0 +1,239 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ai.cloud.skywalking.sample.mybatis.dao.Sampletable1Mapper">
<resultMap id="BaseResultMap" type="com.ai.cloud.skywalking.sample.mybatis.model.Sampletable1">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Sun Jul 24 09:27:32 CST 2016.
-->
<id column="KEY1" jdbcType="VARCHAR" property="key1" />
<result column="VALUE1" jdbcType="VARCHAR" property="value1" />
</resultMap>
<sql id="Example_Where_Clause">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Sun Jul 24 09:27:32 CST 2016.
-->
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Sun Jul 24 09:27:32 CST 2016.
-->
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Sun Jul 24 09:27:32 CST 2016.
-->
KEY1, VALUE1
</sql>
<select id="selectByExample" parameterType="com.ai.cloud.skywalking.sample.mybatis.model.Sampletable1Example" resultMap="BaseResultMap">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Sun Jul 24 09:27:32 CST 2016.
-->
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from PUBLIC.SAMPLETABLE1
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Sun Jul 24 09:27:32 CST 2016.
-->
select
<include refid="Base_Column_List" />
from PUBLIC.SAMPLETABLE1
where KEY1 = #{key1,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Sun Jul 24 09:27:32 CST 2016.
-->
delete from PUBLIC.SAMPLETABLE1
where KEY1 = #{key1,jdbcType=VARCHAR}
</delete>
<delete id="deleteByExample" parameterType="com.ai.cloud.skywalking.sample.mybatis.model.Sampletable1Example">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Sun Jul 24 09:27:32 CST 2016.
-->
delete from PUBLIC.SAMPLETABLE1
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.ai.cloud.skywalking.sample.mybatis.model.Sampletable1">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Sun Jul 24 09:27:32 CST 2016.
-->
insert into PUBLIC.SAMPLETABLE1 (KEY1, VALUE1)
values (#{key1,jdbcType=VARCHAR}, #{value1,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.ai.cloud.skywalking.sample.mybatis.model.Sampletable1">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Sun Jul 24 09:27:32 CST 2016.
-->
insert into PUBLIC.SAMPLETABLE1
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="key1 != null">
KEY1,
</if>
<if test="value1 != null">
VALUE1,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="key1 != null">
#{key1,jdbcType=VARCHAR},
</if>
<if test="value1 != null">
#{value1,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.ai.cloud.skywalking.sample.mybatis.model.Sampletable1Example" resultType="java.lang.Integer">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Sun Jul 24 09:27:32 CST 2016.
-->
select count(*) from PUBLIC.SAMPLETABLE1
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Sun Jul 24 09:27:32 CST 2016.
-->
update PUBLIC.SAMPLETABLE1
<set>
<if test="record.key1 != null">
KEY1 = #{record.key1,jdbcType=VARCHAR},
</if>
<if test="record.value1 != null">
VALUE1 = #{record.value1,jdbcType=VARCHAR},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Sun Jul 24 09:27:32 CST 2016.
-->
update PUBLIC.SAMPLETABLE1
set KEY1 = #{record.key1,jdbcType=VARCHAR},
VALUE1 = #{record.value1,jdbcType=VARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.ai.cloud.skywalking.sample.mybatis.model.Sampletable1">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Sun Jul 24 09:27:32 CST 2016.
-->
update PUBLIC.SAMPLETABLE1
<set>
<if test="value1 != null">
VALUE1 = #{value1,jdbcType=VARCHAR},
</if>
</set>
where KEY1 = #{key1,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="com.ai.cloud.skywalking.sample.mybatis.model.Sampletable1">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Sun Jul 24 09:27:32 CST 2016.
-->
update PUBLIC.SAMPLETABLE1
set VALUE1 = #{value1,jdbcType=VARCHAR}
where KEY1 = #{key1,jdbcType=VARCHAR}
</update>
</mapper>

View File

@ -0,0 +1,239 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ai.cloud.skywalking.sample.mybatis.dao.Sampletable2Mapper">
<resultMap id="BaseResultMap" type="com.ai.cloud.skywalking.sample.mybatis.model.Sampletable2">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Sun Jul 24 09:26:38 CST 2016.
-->
<id column="KEY2" jdbcType="VARCHAR" property="key2" />
<result column="VALUE2" jdbcType="VARCHAR" property="value2" />
</resultMap>
<sql id="Example_Where_Clause">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Sun Jul 24 09:26:38 CST 2016.
-->
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Sun Jul 24 09:26:38 CST 2016.
-->
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Sun Jul 24 09:26:38 CST 2016.
-->
KEY2, VALUE2
</sql>
<select id="selectByExample" parameterType="com.ai.cloud.skywalking.sample.mybatis.model.Sampletable2Example" resultMap="BaseResultMap">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Sun Jul 24 09:26:38 CST 2016.
-->
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from PUBLIC.SAMPLETABLE2
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Sun Jul 24 09:26:38 CST 2016.
-->
select
<include refid="Base_Column_List" />
from PUBLIC.SAMPLETABLE2
where KEY2 = #{key2,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Sun Jul 24 09:26:38 CST 2016.
-->
delete from PUBLIC.SAMPLETABLE2
where KEY2 = #{key2,jdbcType=VARCHAR}
</delete>
<delete id="deleteByExample" parameterType="com.ai.cloud.skywalking.sample.mybatis.model.Sampletable2Example">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Sun Jul 24 09:26:38 CST 2016.
-->
delete from PUBLIC.SAMPLETABLE2
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.ai.cloud.skywalking.sample.mybatis.model.Sampletable2">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Sun Jul 24 09:26:38 CST 2016.
-->
insert into PUBLIC.SAMPLETABLE2 (KEY2, VALUE2)
values (#{key2,jdbcType=VARCHAR}, #{value2,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.ai.cloud.skywalking.sample.mybatis.model.Sampletable2">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Sun Jul 24 09:26:38 CST 2016.
-->
insert into PUBLIC.SAMPLETABLE2
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="key2 != null">
KEY2,
</if>
<if test="value2 != null">
VALUE2,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="key2 != null">
#{key2,jdbcType=VARCHAR},
</if>
<if test="value2 != null">
#{value2,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.ai.cloud.skywalking.sample.mybatis.model.Sampletable2Example" resultType="java.lang.Integer">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Sun Jul 24 09:26:38 CST 2016.
-->
select count(*) from PUBLIC.SAMPLETABLE2
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Sun Jul 24 09:26:38 CST 2016.
-->
update PUBLIC.SAMPLETABLE2
<set>
<if test="record.key2 != null">
KEY2 = #{record.key2,jdbcType=VARCHAR},
</if>
<if test="record.value2 != null">
VALUE2 = #{record.value2,jdbcType=VARCHAR},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Sun Jul 24 09:26:38 CST 2016.
-->
update PUBLIC.SAMPLETABLE2
set KEY2 = #{record.key2,jdbcType=VARCHAR},
VALUE2 = #{record.value2,jdbcType=VARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.ai.cloud.skywalking.sample.mybatis.model.Sampletable2">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Sun Jul 24 09:26:38 CST 2016.
-->
update PUBLIC.SAMPLETABLE2
<set>
<if test="value2 != null">
VALUE2 = #{value2,jdbcType=VARCHAR},
</if>
</set>
where KEY2 = #{key2,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="com.ai.cloud.skywalking.sample.mybatis.model.Sampletable2">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Sun Jul 24 09:26:38 CST 2016.
-->
update PUBLIC.SAMPLETABLE2
set VALUE2 = #{value2,jdbcType=VARCHAR}
where KEY2 = #{key2,jdbcType=VARCHAR}
</update>
</mapper>

View File

@ -0,0 +1,15 @@
<?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="skywalking-sample-dubbo-impl" />
<dubbo:registry address="zookeeper://127.0.0.1:2181" />
<dubbo:protocol name="dubbo" port="20880" />
<dubbo:annotation package="com.ai.cloud.skywalking.sample.dubbo"/>
</beans>

View File

@ -0,0 +1,45 @@
#skyWalking用户ID
skywalking.user_id=123
#skyWalking应用编码
skywalking.application_code=skywalking-sample-dubbo
#skywalking auth的环境变量名字
skywalking.auth_system_env_name=SKYWALKING_RUN
#skywalking数据编码
skywalking.charset=UTF-8
skywalking.auth_override=true
#是否打印数据
buriedpoint.printf=true
#埋点异常的最大长度
buriedpoint.max_exception_stack_length=4000
#业务字段的最大长度
buriedpoint.businesskey_max_length=300
#过滤异常
buriedpoint.exclusive_exceptions=java.lang.RuntimeException
#最大发送者的连接数阀比例
sender.connect_percent=100
#发送服务端配置
sender.servers_addr=127.0.0.1:34000
#最大发送的副本数量
sender.max_copy_num=2
#发送的最大长度
sender.max_send_length=20000
#当没有Sender时,尝试获取sender的等待周期
sender.retry_get_sender_wait_interval=2000
#最大消费线程数
consumer.max_consumer=0
#消费者最大等待时间
consumer.max_wait_time=5
#发送失败等待时间
consumer.consumer_fail_retry_wait_interval=50
#每个Buffer的最大个数
buffer.buffer_max_size=18000
#Buffer池的最大长度
buffer.pool_size=5
#发送检查线程检查周期
senderchecker.check_polling_time=200

View File

@ -0,0 +1,33 @@
<?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:context="http://www.springframework.org/schema/context" xmlns:jdbc="http://www.springframework.org/schema/jdbc"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.1.xsd http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc.xsd">
<!-- 自动扫描 -->
<context:component-scan base-package="com.ai.cloud.skywalking.sample"/>
<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
<property name="dataSource" ref="dataSource"/>
<!-- 自动扫描mapping.xml文件 -->
<property name="mapperLocations" value="classpath:mybatis/*.xml"></property>
</bean>
<bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
<property name="basePackage" value="com.ai.cloud.skywalking.sample.mybatis"/>
<property name="sqlSessionFactoryBeanName" value="sqlSessionFactory"></property>
</bean>
<bean id="transactionManager"
class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="dataSource"/>
</bean>
<jdbc:embedded-database id="dataSource" type="H2">
<jdbc:script location="classpath:db/sql/create-db.sql" />
</jdbc:embedded-database>
<import resource="classpath*:provider/dubbo-provider.xml"/>
</beans>

View File

@ -0,0 +1,11 @@
CREATE TABLE PUBLIC.sampletable1
(
key1 VARCHAR2(36) PRIMARY KEY,
value1 VARCHAR2(36) NOT NULL
);
CREATE TABLE PUBLIC.sampletable2
(
key2 VARCHAR2(36) PRIMARY KEY,
value2 VARCHAR2(36) NOT NULL
);

View File

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
<log4j:configuration>
<appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
<layout class="com.ai.cloud.skywalking.plugin.log.log4j.v1.x.TraceIdPatternLayout">
<param name="ConversionPattern"
value="%x %d - %c -%-4r [%t] %-5p %x - %m%n" />
</layout>
</appender>
<root>
<priority value="debug" />
<appender-ref ref="CONSOLE" />
</root>
</log4j:configuration>

View File

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="debug">
<Appenders>
<Console name="Console" target="SYSTEM_OUT">
<PatternLayout pattern="%d - %c -%-4r [%t] %-5p %x - %m%n"/>
</Console>
</Appenders>
<Loggers>
<Root level="debug">
<AppenderRef ref="Console"/>
</Root>
</Loggers>
</Configuration>

View File

@ -0,0 +1,239 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ai.cloud.skywalking.sample.mybatis.dao.Sampletable1Mapper">
<resultMap id="BaseResultMap" type="com.ai.cloud.skywalking.sample.mybatis.model.Sampletable1">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Sun Jul 24 09:27:32 CST 2016.
-->
<id column="KEY1" jdbcType="VARCHAR" property="key1" />
<result column="VALUE1" jdbcType="VARCHAR" property="value1" />
</resultMap>
<sql id="Example_Where_Clause">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Sun Jul 24 09:27:32 CST 2016.
-->
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Sun Jul 24 09:27:32 CST 2016.
-->
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Sun Jul 24 09:27:32 CST 2016.
-->
KEY1, VALUE1
</sql>
<select id="selectByExample" parameterType="com.ai.cloud.skywalking.sample.mybatis.model.Sampletable1Example" resultMap="BaseResultMap">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Sun Jul 24 09:27:32 CST 2016.
-->
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from PUBLIC.SAMPLETABLE1
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Sun Jul 24 09:27:32 CST 2016.
-->
select
<include refid="Base_Column_List" />
from PUBLIC.SAMPLETABLE1
where KEY1 = #{key1,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Sun Jul 24 09:27:32 CST 2016.
-->
delete from PUBLIC.SAMPLETABLE1
where KEY1 = #{key1,jdbcType=VARCHAR}
</delete>
<delete id="deleteByExample" parameterType="com.ai.cloud.skywalking.sample.mybatis.model.Sampletable1Example">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Sun Jul 24 09:27:32 CST 2016.
-->
delete from PUBLIC.SAMPLETABLE1
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.ai.cloud.skywalking.sample.mybatis.model.Sampletable1">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Sun Jul 24 09:27:32 CST 2016.
-->
insert into PUBLIC.SAMPLETABLE1 (KEY1, VALUE1)
values (#{key1,jdbcType=VARCHAR}, #{value1,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.ai.cloud.skywalking.sample.mybatis.model.Sampletable1">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Sun Jul 24 09:27:32 CST 2016.
-->
insert into PUBLIC.SAMPLETABLE1
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="key1 != null">
KEY1,
</if>
<if test="value1 != null">
VALUE1,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="key1 != null">
#{key1,jdbcType=VARCHAR},
</if>
<if test="value1 != null">
#{value1,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.ai.cloud.skywalking.sample.mybatis.model.Sampletable1Example" resultType="java.lang.Integer">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Sun Jul 24 09:27:32 CST 2016.
-->
select count(*) from PUBLIC.SAMPLETABLE1
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Sun Jul 24 09:27:32 CST 2016.
-->
update PUBLIC.SAMPLETABLE1
<set>
<if test="record.key1 != null">
KEY1 = #{record.key1,jdbcType=VARCHAR},
</if>
<if test="record.value1 != null">
VALUE1 = #{record.value1,jdbcType=VARCHAR},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Sun Jul 24 09:27:32 CST 2016.
-->
update PUBLIC.SAMPLETABLE1
set KEY1 = #{record.key1,jdbcType=VARCHAR},
VALUE1 = #{record.value1,jdbcType=VARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.ai.cloud.skywalking.sample.mybatis.model.Sampletable1">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Sun Jul 24 09:27:32 CST 2016.
-->
update PUBLIC.SAMPLETABLE1
<set>
<if test="value1 != null">
VALUE1 = #{value1,jdbcType=VARCHAR},
</if>
</set>
where KEY1 = #{key1,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="com.ai.cloud.skywalking.sample.mybatis.model.Sampletable1">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Sun Jul 24 09:27:32 CST 2016.
-->
update PUBLIC.SAMPLETABLE1
set VALUE1 = #{value1,jdbcType=VARCHAR}
where KEY1 = #{key1,jdbcType=VARCHAR}
</update>
</mapper>

View File

@ -0,0 +1,239 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ai.cloud.skywalking.sample.mybatis.dao.Sampletable2Mapper">
<resultMap id="BaseResultMap" type="com.ai.cloud.skywalking.sample.mybatis.model.Sampletable2">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Sun Jul 24 09:26:38 CST 2016.
-->
<id column="KEY2" jdbcType="VARCHAR" property="key2" />
<result column="VALUE2" jdbcType="VARCHAR" property="value2" />
</resultMap>
<sql id="Example_Where_Clause">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Sun Jul 24 09:26:38 CST 2016.
-->
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Sun Jul 24 09:26:38 CST 2016.
-->
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Sun Jul 24 09:26:38 CST 2016.
-->
KEY2, VALUE2
</sql>
<select id="selectByExample" parameterType="com.ai.cloud.skywalking.sample.mybatis.model.Sampletable2Example" resultMap="BaseResultMap">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Sun Jul 24 09:26:38 CST 2016.
-->
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from PUBLIC.SAMPLETABLE2
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Sun Jul 24 09:26:38 CST 2016.
-->
select
<include refid="Base_Column_List" />
from PUBLIC.SAMPLETABLE2
where KEY2 = #{key2,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Sun Jul 24 09:26:38 CST 2016.
-->
delete from PUBLIC.SAMPLETABLE2
where KEY2 = #{key2,jdbcType=VARCHAR}
</delete>
<delete id="deleteByExample" parameterType="com.ai.cloud.skywalking.sample.mybatis.model.Sampletable2Example">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Sun Jul 24 09:26:38 CST 2016.
-->
delete from PUBLIC.SAMPLETABLE2
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.ai.cloud.skywalking.sample.mybatis.model.Sampletable2">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Sun Jul 24 09:26:38 CST 2016.
-->
insert into PUBLIC.SAMPLETABLE2 (KEY2, VALUE2)
values (#{key2,jdbcType=VARCHAR}, #{value2,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.ai.cloud.skywalking.sample.mybatis.model.Sampletable2">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Sun Jul 24 09:26:38 CST 2016.
-->
insert into PUBLIC.SAMPLETABLE2
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="key2 != null">
KEY2,
</if>
<if test="value2 != null">
VALUE2,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="key2 != null">
#{key2,jdbcType=VARCHAR},
</if>
<if test="value2 != null">
#{value2,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.ai.cloud.skywalking.sample.mybatis.model.Sampletable2Example" resultType="java.lang.Integer">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Sun Jul 24 09:26:38 CST 2016.
-->
select count(*) from PUBLIC.SAMPLETABLE2
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Sun Jul 24 09:26:38 CST 2016.
-->
update PUBLIC.SAMPLETABLE2
<set>
<if test="record.key2 != null">
KEY2 = #{record.key2,jdbcType=VARCHAR},
</if>
<if test="record.value2 != null">
VALUE2 = #{record.value2,jdbcType=VARCHAR},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Sun Jul 24 09:26:38 CST 2016.
-->
update PUBLIC.SAMPLETABLE2
set KEY2 = #{record.key2,jdbcType=VARCHAR},
VALUE2 = #{record.value2,jdbcType=VARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.ai.cloud.skywalking.sample.mybatis.model.Sampletable2">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Sun Jul 24 09:26:38 CST 2016.
-->
update PUBLIC.SAMPLETABLE2
<set>
<if test="value2 != null">
VALUE2 = #{value2,jdbcType=VARCHAR},
</if>
</set>
where KEY2 = #{key2,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="com.ai.cloud.skywalking.sample.mybatis.model.Sampletable2">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Sun Jul 24 09:26:38 CST 2016.
-->
update PUBLIC.SAMPLETABLE2
set VALUE2 = #{value2,jdbcType=VARCHAR}
where KEY2 = #{key2,jdbcType=VARCHAR}
</update>
</mapper>

View File

@ -0,0 +1,15 @@
<?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="skywalking-sample-dubbo-impl" />
<dubbo:registry address="zookeeper://127.0.0.1:2181" />
<dubbo:protocol name="dubbo" port="20880" />
<dubbo:annotation package="com.ai.cloud.skywalking.sample.dubbo"/>
</beans>

View File

@ -0,0 +1,45 @@
#skyWalking用户ID
skywalking.user_id=123
#skyWalking应用编码
skywalking.application_code=skywalking-sample-dubbo
#skywalking auth的环境变量名字
skywalking.auth_system_env_name=SKYWALKING_RUN
#skywalking数据编码
skywalking.charset=UTF-8
skywalking.auth_override=true
#是否打印数据
buriedpoint.printf=true
#埋点异常的最大长度
buriedpoint.max_exception_stack_length=4000
#业务字段的最大长度
buriedpoint.businesskey_max_length=300
#过滤异常
buriedpoint.exclusive_exceptions=java.lang.RuntimeException
#最大发送者的连接数阀比例
sender.connect_percent=100
#发送服务端配置
sender.servers_addr=127.0.0.1:34000
#最大发送的副本数量
sender.max_copy_num=2
#发送的最大长度
sender.max_send_length=20000
#当没有Sender时,尝试获取sender的等待周期
sender.retry_get_sender_wait_interval=2000
#最大消费线程数
consumer.max_consumer=0
#消费者最大等待时间
consumer.max_wait_time=5
#发送失败等待时间
consumer.consumer_fail_retry_wait_interval=50
#每个Buffer的最大个数
buffer.buffer_max_size=18000
#Buffer池的最大长度
buffer.pool_size=5
#发送检查线程检查周期
senderchecker.check_polling_time=200

View File

@ -0,0 +1,33 @@
<?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:context="http://www.springframework.org/schema/context" xmlns:jdbc="http://www.springframework.org/schema/jdbc"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.1.xsd http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc.xsd">
<!-- 自动扫描 -->
<context:component-scan base-package="com.ai.cloud.skywalking.sample"/>
<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
<property name="dataSource" ref="dataSource"/>
<!-- 自动扫描mapping.xml文件 -->
<property name="mapperLocations" value="classpath:mybatis/*.xml"></property>
</bean>
<bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
<property name="basePackage" value="com.ai.cloud.skywalking.sample.mybatis"/>
<property name="sqlSessionFactoryBeanName" value="sqlSessionFactory"></property>
</bean>
<bean id="transactionManager"
class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="dataSource"/>
</bean>
<jdbc:embedded-database id="dataSource" type="H2">
<jdbc:script location="classpath:db/sql/create-db.sql" />
</jdbc:embedded-database>
<import resource="classpath*:provider/dubbo-provider.xml"/>
</beans>

View File

@ -0,0 +1,23 @@
<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>example-dubbo</artifactId>
<groupId>com.ai.cloud</groupId>
<version>1.0-Final</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>dubbo-interfaces</artifactId>
<packaging>jar</packaging>
<name>dubbo-interfaces</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
</dependencies>
</project>

View File

@ -0,0 +1,5 @@
package com.ai.cloud.skywalking.sample.dubbo.interfaces;
public interface SampleDubboInterface {
String callMethodByDubbox(String param1);
}

View File

@ -0,0 +1,23 @@
<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>skywalking-example</artifactId>
<groupId>com.ai.cloud</groupId>
<version>1.0-Final</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>example-dubbo</artifactId>
<packaging>pom</packaging>
<name>example-dubbo</name>
<url>http://maven.apache.org</url>
<modules>
<module>dubbo-interfaces</module>
<module>dubbo-impl</module>
</modules>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
</project>

View File

@ -0,0 +1,83 @@
<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">
<parent>
<artifactId>skywalking-example</artifactId>
<groupId>com.ai.cloud</groupId>
<version>1.0-Final</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>example-web</artifactId>
<packaging>war</packaging>
<name>example-web Maven Webapp</name>
<url>http://maven.apache.org</url>
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>4.3.1.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>4.3.1.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>4.3.1.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>4.3.1.RELEASE</version>
</dependency>
<dependency>
<groupId>javax.servlet.jsp.jstl</groupId>
<artifactId>jstl-api</artifactId>
<version>1.2</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
<version>4.3.1.RELEASE</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.1.0</version>
</dependency>
<dependency>
<groupId>com.ai.cloud</groupId>
<artifactId>dubbo-interfaces</artifactId>
<version>1.0-Final</version>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>dubbox</artifactId>
<version>2.8.4</version>
</dependency>
<dependency>
<groupId>org.javassist</groupId>
<artifactId>javassist</artifactId>
<version>3.18.1-GA</version>
</dependency>
<dependency>
<groupId>com.101tec</groupId>
<artifactId>zkclient</artifactId>
<version>0.7</version>
</dependency>
<dependency>
<groupId>com.ai.cloud</groupId>
<artifactId>skywalking-log4j-1.x-plugin</artifactId>
<version>1.0-Final</version>
</dependency>
<dependency>
<groupId>com.ai.cloud</groupId>
<artifactId>skywalking-log4j-2.x-plugin</artifactId>
<version>1.0-Final</version>
</dependency>
</dependencies>
<build>
<finalName>example-web</finalName>
</build>
</project>

View File

@ -0,0 +1,28 @@
package com.ai.cloud.skywalking.sample.web.controller;
import com.ai.cloud.skywalking.sample.dubbo.interfaces.SampleDubboInterface;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;
import java.util.UUID;
@Controller
@RequestMapping("/sample")
public class SampleWebController {
private Logger logger = LogManager.getLogger(SampleWebController.class);
@Autowired
private SampleDubboInterface sampleDubboInterface;
@RequestMapping("/normal")
public ModelAndView samplePath(){
logger.info("Start.....");
ModelAndView modelAndView = new ModelAndView("saveSuccess");
String generateKey = sampleDubboInterface.callMethodByDubbox(UUID.randomUUID().toString());
modelAndView.addObject("key",generateKey);
return modelAndView;
}
}

View File

@ -0,0 +1,12 @@
<?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="skywalking-sample-dubbo-consumer"/>
<dubbo:registry protocol="zookeeper" address="127.0.0.1:2181"/>
<dubbo:reference id="sampleDubboInterface" interface="com.ai.cloud.skywalking.sample.dubbo.interfaces.SampleDubboInterface"/>
</beans>

View File

@ -0,0 +1,9 @@
log4j.rootLogger=DEBUG, A1
#log4j.appender.A1=org.apache.log4j.FileAppender
#log4j.appender.A1.File=${catalina.base}/logs/mvno_crm_all.log
#log4j.appender.A1.layout=org.apache.log4j.PatternLayout
#log4j.appender.A1.layout.ConversionPattern=%-d{yyyy-MM-dd HH:mm:ss.SSS} %c %n[%p] %n%m%n
log4j.appender.A1=org.apache.log4j.ConsoleAppender
log4j.appender.A1.layout=com.ai.cloud.skywalking.plugin.log.log4j.v1.x.TraceIdPatternLayout
log4j.appender.A1.layout.ConversionPattern=%x %-d{yyyy-MM-dd HH:mm:ss.SSS} %c %n[%p] %n%m%n

View File

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="debug">
<Appenders>
<Console name="Console" target="SYSTEM_OUT">
<PatternLayout pattern="%d - %c -%-4r [%t] %-5p %x - %m%n"/>
</Console>
</Appenders>
<Loggers>
<Root level="debug">
<AppenderRef ref="Console"/>
</Root>
</Loggers>
</Configuration>

View File

@ -0,0 +1,45 @@
#skyWalking用户ID
skywalking.user_id=123
#skyWalking应用编码
skywalking.application_code=skywalking-sample-dubbo
#skywalking auth的环境变量名字
skywalking.auth_system_env_name=SKYWALKING_RUN
#skywalking数据编码
skywalking.charset=UTF-8
skywalking.auth_override=true
#是否打印数据
buriedpoint.printf=true
#埋点异常的最大长度
buriedpoint.max_exception_stack_length=4000
#业务字段的最大长度
buriedpoint.businesskey_max_length=300
#过滤异常
buriedpoint.exclusive_exceptions=java.lang.RuntimeException
#最大发送者的连接数阀比例
sender.connect_percent=100
#发送服务端配置
sender.servers_addr=127.0.0.1:34000
#最大发送的副本数量
sender.max_copy_num=2
#发送的最大长度
sender.max_send_length=20000
#当没有Sender时,尝试获取sender的等待周期
sender.retry_get_sender_wait_interval=2000
#最大消费线程数
consumer.max_consumer=0
#消费者最大等待时间
consumer.max_wait_time=5
#发送失败等待时间
consumer.consumer_fail_retry_wait_interval=50
#每个Buffer的最大个数
buffer.buffer_max_size=18000
#Buffer池的最大长度
buffer.pool_size=5
#发送检查线程检查周期
senderchecker.check_polling_time=200

View File

@ -0,0 +1,25 @@
<?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:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd">
<context:component-scan base-package="com.ai.cloud.skywalking.sample.web.controller"></context:component-scan>
<mvc:annotation-driven></mvc:annotation-driven>
<bean id="viewResolver" class="org.springframework.web.servlet.view.UrlBasedViewResolver">
<property name="viewClass"
value="org.springframework.web.servlet.view.JstlView"/>
<property name="prefix" value="/pages/"/>
<property name="suffix" value=".jsp"/>
</bean>
<import resource="classpath*:consumer/dubbo-consumer.xml"/>
</beans>

View File

@ -0,0 +1,39 @@
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
version="2.5">
<display-name>skywalking-example-web</display-name>
<servlet>
<servlet-name>springMVC</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath*:spring-context.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>springMVC</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
<filter>
<filter-name>encodingFilter</filter-name>
<filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
<init-param>
<param-name>encoding</param-name>
<param-value>UTF-8</param-value>
</init-param>
<init-param>
<param-name>forceEncoding</param-name>
<param-value>true</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>encodingFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
</web-app>

View File

@ -0,0 +1,5 @@
<html>
<body>
<h2>Hello World!</h2>
</body>
</html>

View File

@ -0,0 +1,16 @@
<%--
Created by IntelliJ IDEA.
User: xin
Date: 16/7/24
Time: 上午10:29
To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
<title>Success!!!</title>
</head>
<body>
You have save success!!! KEY:${key}
</body>
</html>

View File

@ -0,0 +1,12 @@
<?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="skywalking-sample-dubbo-consumer"/>
<dubbo:registry protocol="zookeeper" address="127.0.0.1:2181"/>
<dubbo:reference id="sampleDubboInterface" interface="com.ai.cloud.skywalking.sample.dubbo.interfaces.SampleDubboInterface"/>
</beans>

View File

@ -0,0 +1,9 @@
log4j.rootLogger=DEBUG, A1
#log4j.appender.A1=org.apache.log4j.FileAppender
#log4j.appender.A1.File=${catalina.base}/logs/mvno_crm_all.log
#log4j.appender.A1.layout=org.apache.log4j.PatternLayout
#log4j.appender.A1.layout.ConversionPattern=%-d{yyyy-MM-dd HH:mm:ss.SSS} %c %n[%p] %n%m%n
log4j.appender.A1=org.apache.log4j.ConsoleAppender
log4j.appender.A1.layout=com.ai.cloud.skywalking.plugin.log.log4j.v1.x.TraceIdPatternLayout
log4j.appender.A1.layout.ConversionPattern=%x %-d{yyyy-MM-dd HH:mm:ss.SSS} %c %n[%p] %n%m%n

View File

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="debug">
<Appenders>
<Console name="Console" target="SYSTEM_OUT">
<PatternLayout pattern="%d - %c -%-4r [%t] %-5p %x - %m%n"/>
</Console>
</Appenders>
<Loggers>
<Root level="debug">
<AppenderRef ref="Console"/>
</Root>
</Loggers>
</Configuration>

View File

@ -0,0 +1,45 @@
#skyWalking用户ID
skywalking.user_id=123
#skyWalking应用编码
skywalking.application_code=skywalking-sample-dubbo
#skywalking auth的环境变量名字
skywalking.auth_system_env_name=SKYWALKING_RUN
#skywalking数据编码
skywalking.charset=UTF-8
skywalking.auth_override=true
#是否打印数据
buriedpoint.printf=true
#埋点异常的最大长度
buriedpoint.max_exception_stack_length=4000
#业务字段的最大长度
buriedpoint.businesskey_max_length=300
#过滤异常
buriedpoint.exclusive_exceptions=java.lang.RuntimeException
#最大发送者的连接数阀比例
sender.connect_percent=100
#发送服务端配置
sender.servers_addr=127.0.0.1:34000
#最大发送的副本数量
sender.max_copy_num=2
#发送的最大长度
sender.max_send_length=20000
#当没有Sender时,尝试获取sender的等待周期
sender.retry_get_sender_wait_interval=2000
#最大消费线程数
consumer.max_consumer=0
#消费者最大等待时间
consumer.max_wait_time=5
#发送失败等待时间
consumer.consumer_fail_retry_wait_interval=50
#每个Buffer的最大个数
buffer.buffer_max_size=18000
#Buffer池的最大长度
buffer.pool_size=5
#发送检查线程检查周期
senderchecker.check_polling_time=200

View File

@ -0,0 +1,25 @@
<?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:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd">
<context:component-scan base-package="com.ai.cloud.skywalking.sample.web.controller"></context:component-scan>
<mvc:annotation-driven></mvc:annotation-driven>
<bean id="viewResolver" class="org.springframework.web.servlet.view.UrlBasedViewResolver">
<property name="viewClass"
value="org.springframework.web.servlet.view.JstlView"/>
<property name="prefix" value="/pages/"/>
<property name="suffix" value=".jsp"/>
</bean>
<import resource="classpath*:consumer/dubbo-consumer.xml"/>
</beans>

View File

@ -0,0 +1,5 @@
Manifest-Version: 1.0
Built-By: xin
Created-By: IntelliJ IDEA
Build-Jdk: 1.8.0_91

View File

@ -0,0 +1,12 @@
<?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="skywalking-sample-dubbo-consumer"/>
<dubbo:registry protocol="zookeeper" address="127.0.0.1:2181"/>
<dubbo:reference id="sampleDubboInterface" interface="com.ai.cloud.skywalking.sample.dubbo.interfaces.SampleDubboInterface"/>
</beans>

View File

@ -0,0 +1,9 @@
log4j.rootLogger=DEBUG, A1
#log4j.appender.A1=org.apache.log4j.FileAppender
#log4j.appender.A1.File=${catalina.base}/logs/mvno_crm_all.log
#log4j.appender.A1.layout=org.apache.log4j.PatternLayout
#log4j.appender.A1.layout.ConversionPattern=%-d{yyyy-MM-dd HH:mm:ss.SSS} %c %n[%p] %n%m%n
log4j.appender.A1=org.apache.log4j.ConsoleAppender
log4j.appender.A1.layout=com.ai.cloud.skywalking.plugin.log.log4j.v1.x.TraceIdPatternLayout
log4j.appender.A1.layout.ConversionPattern=%x %-d{yyyy-MM-dd HH:mm:ss.SSS} %c %n[%p] %n%m%n

View File

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="debug">
<Appenders>
<Console name="Console" target="SYSTEM_OUT">
<PatternLayout pattern="%d - %c -%-4r [%t] %-5p %x - %m%n"/>
</Console>
</Appenders>
<Loggers>
<Root level="debug">
<AppenderRef ref="Console"/>
</Root>
</Loggers>
</Configuration>

View File

@ -0,0 +1,45 @@
#skyWalking用户ID
skywalking.user_id=123
#skyWalking应用编码
skywalking.application_code=skywalking-sample-dubbo
#skywalking auth的环境变量名字
skywalking.auth_system_env_name=SKYWALKING_RUN
#skywalking数据编码
skywalking.charset=UTF-8
skywalking.auth_override=true
#是否打印数据
buriedpoint.printf=true
#埋点异常的最大长度
buriedpoint.max_exception_stack_length=4000
#业务字段的最大长度
buriedpoint.businesskey_max_length=300
#过滤异常
buriedpoint.exclusive_exceptions=java.lang.RuntimeException
#最大发送者的连接数阀比例
sender.connect_percent=100
#发送服务端配置
sender.servers_addr=127.0.0.1:34000
#最大发送的副本数量
sender.max_copy_num=2
#发送的最大长度
sender.max_send_length=20000
#当没有Sender时,尝试获取sender的等待周期
sender.retry_get_sender_wait_interval=2000
#最大消费线程数
consumer.max_consumer=0
#消费者最大等待时间
consumer.max_wait_time=5
#发送失败等待时间
consumer.consumer_fail_retry_wait_interval=50
#每个Buffer的最大个数
buffer.buffer_max_size=18000
#Buffer池的最大长度
buffer.pool_size=5
#发送检查线程检查周期
senderchecker.check_polling_time=200

View File

@ -0,0 +1,25 @@
<?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:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd">
<context:component-scan base-package="com.ai.cloud.skywalking.sample.web.controller"></context:component-scan>
<mvc:annotation-driven></mvc:annotation-driven>
<bean id="viewResolver" class="org.springframework.web.servlet.view.UrlBasedViewResolver">
<property name="viewClass"
value="org.springframework.web.servlet.view.JstlView"/>
<property name="prefix" value="/pages/"/>
<property name="suffix" value=".jsp"/>
</bean>
<import resource="classpath*:consumer/dubbo-consumer.xml"/>
</beans>

View File

@ -0,0 +1,39 @@
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
version="2.5">
<display-name>skywalking-example-web</display-name>
<servlet>
<servlet-name>springMVC</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath*:spring-context.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>springMVC</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
<filter>
<filter-name>encodingFilter</filter-name>
<filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
<init-param>
<param-name>encoding</param-name>
<param-value>UTF-8</param-value>
</init-param>
<init-param>
<param-name>forceEncoding</param-name>
<param-value>true</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>encodingFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
</web-app>

View File

@ -0,0 +1,5 @@
<html>
<body>
<h2>Hello World!</h2>
</body>
</html>

View File

@ -0,0 +1,16 @@
<%--
Created by IntelliJ IDEA.
User: xin
Date: 16/7/24
Time: 上午10:29
To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
<title>Success!!!</title>
</head>
<body>
You have save success!!! KEY:${key}
</body>
</html>

View File

@ -0,0 +1,33 @@
<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>com.ai.cloud</groupId>
<artifactId>skywalking-example</artifactId>
<version>1.0-Final</version>
<modules>
<module>example-web</module>
<module>example-dubbo</module>
</modules>
<packaging>pom</packaging>
<name>skywalking-example</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.7</source>
<target>1.7</target>
<encoding>${project.build.sourceEncoding}</encoding>
</configuration>
</plugin>
</plugins>
</build>
</project>