Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
武汉红喜
whatsmars
提交
6497c411
W
whatsmars
项目概览
武汉红喜
/
whatsmars
通知
3
Star
0
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
W
whatsmars
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
6497c411
编写于
2月 01, 2018
作者:
武汉红喜
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
delete motan
上级
67be3184
变更
20
隐藏空白更改
内联
并排
Showing
20 changed file
with
2 addition
and
683 deletion
+2
-683
README.md
README.md
+2
-2
pom.xml
pom.xml
+0
-1
whatsmars-motan/README.md
whatsmars-motan/README.md
+0
-1
whatsmars-motan/pom.xml
whatsmars-motan/pom.xml
+0
-27
whatsmars-motan/whatsmars-motan-api/pom.xml
whatsmars-motan/whatsmars-motan-api/pom.xml
+0
-18
whatsmars-motan/whatsmars-motan-api/src/main/java/org/hongxi/whatsmars/motan/api/MotanDemoService.java
...java/org/hongxi/whatsmars/motan/api/MotanDemoService.java
+0
-9
whatsmars-motan/whatsmars-motan-consumer/pom.xml
whatsmars-motan/whatsmars-motan-consumer/pom.xml
+0
-111
whatsmars-motan/whatsmars-motan-consumer/src/main/java/org/hongxi/whatsmars/motan/consumer/App.java
...rc/main/java/org/hongxi/whatsmars/motan/consumer/App.java
+0
-16
whatsmars-motan/whatsmars-motan-consumer/src/main/java/org/hongxi/whatsmars/motan/consumer/DemoCommandRunner.java
...rg/hongxi/whatsmars/motan/consumer/DemoCommandRunner.java
+0
-28
whatsmars-motan/whatsmars-motan-consumer/src/main/java/org/hongxi/whatsmars/motan/consumer/MotanSwitcherRunner.java
.../hongxi/whatsmars/motan/consumer/MotanSwitcherRunner.java
+0
-21
whatsmars-motan/whatsmars-motan-consumer/src/main/resources/application.properties
...-motan-consumer/src/main/resources/application.properties
+0
-1
whatsmars-motan/whatsmars-motan-consumer/src/main/resources/log4j.properties
...tsmars-motan-consumer/src/main/resources/log4j.properties
+0
-74
whatsmars-motan/whatsmars-motan-consumer/src/main/resources/spring/demo_motan.xml
...s-motan-consumer/src/main/resources/spring/demo_motan.xml
+0
-32
whatsmars-motan/whatsmars-motan-consumer/src/main/resources/spring/demo_motan_client.xml
...-consumer/src/main/resources/spring/demo_motan_client.xml
+0
-40
whatsmars-motan/whatsmars-motan-provider/pom.xml
whatsmars-motan/whatsmars-motan-provider/pom.xml
+0
-112
whatsmars-motan/whatsmars-motan-provider/src/main/java/org/hongxi/whatsmars/motan/provider/App.java
...rc/main/java/org/hongxi/whatsmars/motan/provider/App.java
+0
-15
whatsmars-motan/whatsmars-motan-provider/src/main/java/org/hongxi/whatsmars/motan/provider/MotanSwitcherRunner.java
.../hongxi/whatsmars/motan/provider/MotanSwitcherRunner.java
+0
-21
whatsmars-motan/whatsmars-motan-provider/src/main/java/org/hongxi/whatsmars/motan/provider/resource/MotanDemoServiceImpl.java
...atsmars/motan/provider/resource/MotanDemoServiceImpl.java
+0
-30
whatsmars-motan/whatsmars-motan-provider/src/main/resources/log4j.properties
...tsmars-motan-provider/src/main/resources/log4j.properties
+0
-74
whatsmars-motan/whatsmars-motan-provider/src/main/resources/spring/motan_demo_server.xml
...-provider/src/main/resources/spring/motan_demo_server.xml
+0
-50
未找到文件。
README.md
浏览文件 @
6497c411
...
...
@@ -17,11 +17,11 @@ whatsmars-sharding-jdbc | 开源分布式数据库中间件
whatsmars-elasticjob | 分布式调度
whatsmars-dubbo | 阿里分布式RPC(服务化)框架
whatsmars-mq | 消息中间件rocketmq,activemq
whatsmars-redis | redis客户端简单封装
whatsmars-rpc | RPC & Protocol
whatsmars-spring-boot | springboot实战
whatsmars-spring-cloud | springcloud demo
whatsmars-redis | redis客户端简单封装
whatsmars-motan | 微博分布式RPC框架
whatsmars-spring-boot-samples | 常用spring-boot-starters演示
### More projects
-
[
*阿里巴巴开源分布式RPC框架Dubbo*
](
https://github.com/alibaba/dubbo
)
...
...
pom.xml
浏览文件 @
6497c411
...
...
@@ -21,7 +21,6 @@
<module>
whatsmars-dubbo
</module>
<module>
whatsmars-mq
</module>
<module>
whatsmars-redis
</module>
<module>
whatsmars-motan
</module>
<module>
whatsmars-spring-cloud
</module>
<module>
whatsmars-sharding-jdbc
</module>
<module>
whatsmars-earth
</module>
...
...
whatsmars-motan/README.md
已删除
100644 → 0
浏览文件 @
67be3184
https://github.com/weibocom/motan
\ No newline at end of file
whatsmars-motan/pom.xml
已删除
100644 → 0
浏览文件 @
67be3184
<?xml version="1.0" encoding="UTF-8"?>
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<parent>
<artifactId>
whatsmars-parent
</artifactId>
<groupId>
org.hongxi
</groupId>
<version>
1.0-SNAPSHOT
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<artifactId>
whatsmars-motan
</artifactId>
<packaging>
pom
</packaging>
<name>
${project.artifactId}
</name>
<description>
The demo module of motan project
</description>
<properties>
<motan.version>
1.0.0
</motan.version>
</properties>
<modules>
<module>
whatsmars-motan-api
</module>
<module>
whatsmars-motan-provider
</module>
<module>
whatsmars-motan-consumer
</module>
</modules>
</project>
\ No newline at end of file
whatsmars-motan/whatsmars-motan-api/pom.xml
已删除
100644 → 0
浏览文件 @
67be3184
<?xml version="1.0" encoding="UTF-8"?>
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<parent>
<artifactId>
whatsmars-motan
</artifactId>
<groupId>
org.hongxi
</groupId>
<version>
1.0-SNAPSHOT
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<artifactId>
whatsmars-motan-api
</artifactId>
<packaging>
jar
</packaging>
<name>
${project.artifactId}
</name>
<description>
The demo module of motan project
</description>
</project>
\ No newline at end of file
whatsmars-motan/whatsmars-motan-api/src/main/java/org/hongxi/whatsmars/motan/api/MotanDemoService.java
已删除
100644 → 0
浏览文件 @
67be3184
package
org.hongxi.whatsmars.motan.api
;
/**
* Created by shenhongxi on 2017/6/29.
*/
public
interface
MotanDemoService
{
String
hello
(
String
name
);
}
whatsmars-motan/whatsmars-motan-consumer/pom.xml
已删除
100644 → 0
浏览文件 @
67be3184
<?xml version="1.0" encoding="UTF-8"?>
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<parent>
<groupId>
org.hongxi
</groupId>
<artifactId>
whatsmars-motan
</artifactId>
<version>
1.0-SNAPSHOT
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<artifactId>
whatsmars-motan-consumer
</artifactId>
<packaging>
jar
</packaging>
<name>
${project.artifactId}
</name>
<description>
The demo module of motan project
</description>
<properties>
<!-- The main class to start by executing java -jar -->
<start-class>
org.hongxi.whatsmars.motan.consumer.App
</start-class>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-dependencies
</artifactId>
<version>
${spring-boot.version}
</version>
<type>
pom
</type>
<scope>
import
</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter
</artifactId>
</dependency>
<!--weibo motan-->
<dependency>
<groupId>
com.weibo
</groupId>
<artifactId>
motan-core
</artifactId>
<version>
${motan.version}
</version>
</dependency>
<dependency>
<groupId>
com.weibo
</groupId>
<artifactId>
motan-transport-netty
</artifactId>
<version>
${motan.version}
</version>
</dependency>
<dependency>
<groupId>
com.weibo
</groupId>
<artifactId>
motan-registry-consul
</artifactId>
<version>
${motan.version}
</version>
</dependency>
<dependency>
<groupId>
com.weibo
</groupId>
<artifactId>
motan-registry-zookeeper
</artifactId>
<version>
${motan.version}
</version>
</dependency>
<!-- dependencies blow were only needed for spring-based features -->
<dependency>
<groupId>
com.weibo
</groupId>
<artifactId>
motan-springsupport
</artifactId>
<version>
${motan.version}
</version>
</dependency>
<dependency>
<groupId>
org.hongxi
</groupId>
<artifactId>
whatsmars-motan-api
</artifactId>
<version>
1.0-SNAPSHOT
</version>
</dependency>
</dependencies>
<build>
<finalName>
${project.artifactId}
</finalName>
<resources>
<resource>
<directory>
src/main/resources
</directory>
<filtering>
true
</filtering>
</resource>
</resources>
<plugins>
<plugin>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-maven-plugin
</artifactId>
<dependencies>
<dependency>
<groupId>
org.springframework
</groupId>
<artifactId>
springloaded
</artifactId>
<version>
${springloaded.version}
</version>
</dependency>
</dependencies>
<!-- POM不是继承spring-boot-starter-parent的话,需要下面的指定 -->
<configuration>
<mainClass>
${start-class}
</mainClass>
<layout>
ZIP
</layout>
</configuration>
<executions>
<execution>
<goals>
<goal>
repackage
</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
\ No newline at end of file
whatsmars-motan/whatsmars-motan-consumer/src/main/java/org/hongxi/whatsmars/motan/consumer/App.java
已删除
100644 → 0
浏览文件 @
67be3184
package
org.hongxi.whatsmars.motan.consumer
;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
import
org.springframework.context.annotation.ImportResource
;
@SpringBootApplication
// 注意:依赖包里满足条件的配置也会加载进来,这里以demo开头确保只加载本module下的配置
@ImportResource
(
locations
={
"classpath*:spring/demo*.xml"
})
public
class
App
{
public
static
void
main
(
String
[]
args
)
{
SpringApplication
.
run
(
App
.
class
,
args
);
}
}
\ No newline at end of file
whatsmars-motan/whatsmars-motan-consumer/src/main/java/org/hongxi/whatsmars/motan/consumer/DemoCommandRunner.java
已删除
100644 → 0
浏览文件 @
67be3184
package
org.hongxi.whatsmars.motan.consumer
;
import
org.hongxi.whatsmars.motan.api.MotanDemoService
;
import
org.springframework.boot.CommandLineRunner
;
import
org.springframework.core.annotation.Order
;
import
org.springframework.stereotype.Component
;
import
javax.annotation.Resource
;
/**
* Created by javahongxi on 2017/6/30.
*/
@Component
@Order
(
value
=
2
)
public
class
DemoCommandRunner
implements
CommandLineRunner
{
@Resource
(
name
=
"motanDemoService"
)
private
MotanDemoService
motanDemoService
;
@Override
public
void
run
(
String
...
strings
)
throws
Exception
{
for
(
int
i
=
0
;
i
<
Integer
.
MAX_VALUE
;
i
++)
{
System
.
out
.
println
(
motanDemoService
.
hello
(
"motan"
+
i
));
Thread
.
sleep
(
500
);
}
System
.
out
.
println
(
"motan demo is finish."
);
System
.
exit
(
0
);
}
}
whatsmars-motan/whatsmars-motan-consumer/src/main/java/org/hongxi/whatsmars/motan/consumer/MotanSwitcherRunner.java
已删除
100644 → 0
浏览文件 @
67be3184
package
org.hongxi.whatsmars.motan.consumer
;
import
com.weibo.api.motan.common.MotanConstants
;
import
com.weibo.api.motan.util.MotanSwitcherUtil
;
import
org.springframework.boot.CommandLineRunner
;
import
org.springframework.core.annotation.Order
;
import
org.springframework.stereotype.Component
;
/**
* Created by shenhongxi on 2017/6/30.
*/
@Component
@Order
(
value
=
1
)
public
class
MotanSwitcherRunner
implements
CommandLineRunner
{
@Override
public
void
run
(
String
...
args
)
throws
Exception
{
// 在使用注册中心时要主动调用下面代码
MotanSwitcherUtil
.
setSwitcherValue
(
MotanConstants
.
REGISTRY_HEARTBEAT_SWITCHER
,
true
);
System
.
out
.
println
(
"consumer started..."
);
}
}
whatsmars-motan/whatsmars-motan-consumer/src/main/resources/application.properties
已删除
100644 → 0
浏览文件 @
67be3184
server.port
:
8088
\ No newline at end of file
whatsmars-motan/whatsmars-motan-consumer/src/main/resources/log4j.properties
已删除
100644 → 0
浏览文件 @
67be3184
#
# Copyright 2009-2016 Weibo, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
log4j.rootLogger
=
warn
log4j.logger.info
=
info,infofile
log4j.logger.warn
=
warn,warnfile
log4j.logger.error
=
error,errorfile
log4j.logger.profile
=
info,profile
log4j.logger.trace
=
trace,tracefile
log4j.logger.accessLog
=
debug,accessfile
log4j.logger.serviceStatsLog
=
info,serviceStatsLog
log4j.appender.tracefile
=
org.apache.log4j.DailyRollingFileAppender
log4j.appender.tracefile.file
=
./logs/server/trace.log
log4j.appender.tracefile.DatePattern
=
'.'yyyyMMdd
log4j.appender.tracefile.layout
=
org.apache.log4j.PatternLayout
log4j.appender.tracefile.layout.ConversionPattern
=
%-d{yyyy-MM-dd HH:mm:ss} [%p] %m%n
log4j.appender.accessfile
=
org.apache.log4j.DailyRollingFileAppender
log4j.appender.accessfile.file
=
./logs/server/access.log
log4j.appender.accessfile.DatePattern
=
'.'yyyyMMdd
log4j.appender.accessfile.layout
=
org.apache.log4j.PatternLayout
log4j.appender.accessfile.layout.ConversionPattern
=
%-d{yyyy-MM-dd HH:mm:ss} [%p] %m%n
log4j.appender.stdout
=
org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout
=
org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern
=
%p %d{yy/MM/dd HH:mm:ss} %-50.50c(%L) - %m%n
log4j.appender.infofile
=
org.apache.log4j.DailyRollingFileAppender
log4j.appender.infofile.file
=
./logs/server/info.log
log4j.appender.infofile.DatePattern
=
'.'yyyyMMdd-HH
log4j.appender.infofile.layout
=
org.apache.log4j.PatternLayout
log4j.appender.infofile.layout.ConversionPattern
=
%-d{yyyy-MM-dd HH:mm:ss} [%p] %m%n
log4j.appender.warnfile
=
org.apache.log4j.DailyRollingFileAppender
log4j.appender.warnfile.file
=
./logs/server/warn.log
log4j.appender.warnfile.DatePattern
=
'.'yyyyMMdd
log4j.appender.warnfile.layout
=
org.apache.log4j.PatternLayout
log4j.appender.warnfile.layout.ConversionPattern
=
%-d{yyyy-MM-dd HH:mm:ss} [%p] %m%n
log4j.appender.errorfile
=
org.apache.log4j.DailyRollingFileAppender
log4j.appender.errorfile.file
=
./logs/server/error.log
log4j.appender.errorfile.DatePattern
=
'.'yyyyMMdd
log4j.appender.errorfile.layout
=
org.apache.log4j.PatternLayout
log4j.appender.errorfile.layout.ConversionPattern
=
%-d{yyyy-MM-dd HH:mm:ss} [%p] %m%n
#profile
log4j.appender.profile
=
org.apache.log4j.DailyRollingFileAppender
log4j.appender.profile.file
=
./logs/server/profile.log
log4j.appender.profile.DatePattern
=
'.'yyyyMMdd-HH
log4j.appender.profile.layout
=
org.apache.log4j.PatternLayout
log4j.appender.profile.layout.ConversionPattern
=
%-d{yyyy-MM-dd HH:mm:ss} %m%n
#serviceStats
log4j.appender.serviceStatsLog
=
org.apache.log4j.DailyRollingFileAppender
log4j.appender.serviceStatsLog.file
=
./logs/server/serverserviceStatsLog.log
log4j.appender.serviceStatsLog.DatePattern
=
'.'yyyyMMdd
log4j.appender.serviceStatsLog.layout
=
org.apache.log4j.PatternLayout
log4j.appender.serviceStatsLog.layout.ConversionPattern
=
%-d{HH:mm:ss} %m%n
whatsmars-motan/whatsmars-motan-consumer/src/main/resources/spring/demo_motan.xml
已删除
100644 → 0
浏览文件 @
67be3184
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright 2009-2016 Weibo, Inc.
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<beans
xmlns=
"http://www.springframework.org/schema/beans"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xmlns:motan=
"http://api.weibo.com/schema/motan"
xsi:schemaLocation=
"http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://api.weibo.com/schema/motan http://api.weibo.com/schema/motan.xsd"
>
<!-- 注册中心配置 使用不同注册中心需要依赖对应的jar包。如果不使用注册中心,可以把check属性改为false,忽略注册失败。-->
<!--<motan:registry regProtocol="local" name="registry" />-->
<!--<motan:registry regProtocol="consul" name="registry" address="127.0.0.1:8500"/>-->
<motan:registry
regProtocol=
"zookeeper"
name=
"registry"
address=
"127.0.0.1:2181"
/>
</beans>
whatsmars-motan/whatsmars-motan-consumer/src/main/resources/spring/demo_motan_client.xml
已删除
100644 → 0
浏览文件 @
67be3184
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright 2009-2016 Weibo, Inc.
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<beans
xmlns=
"http://www.springframework.org/schema/beans"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xmlns:motan=
"http://api.weibo.com/schema/motan"
xsi:schemaLocation=
"http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://api.weibo.com/schema/motan http://api.weibo.com/schema/motan.xsd"
>
<!-- motan协议配置 -->
<motan:protocol
default=
"true"
name=
"motan"
haStrategy=
"failover"
loadbalance=
"roundrobin"
maxClientConnection=
"10"
minClientConnection=
"2"
/>
<!-- 通用referer基础配置 -->
<motan:basicReferer
requestTimeout=
"200"
accessLog=
"false"
retries=
"2"
group=
"motan-demo-rpc"
module=
"motan-demo-rpc"
application=
"myMotanDemo"
protocol=
"motan"
registry=
"registry"
id=
"motantestClientBasicConfig"
throwException=
"false"
check=
"true"
/>
<!-- 具体referer配置。使用方通过beanid使用服务接口类 -->
<motan:referer
id=
"motanDemoService"
interface=
"org.hongxi.whatsmars.motan.api.MotanDemoService"
connectTimeout=
"300"
requestTimeout=
"300"
basicReferer=
"motantestClientBasicConfig"
/>
</beans>
\ No newline at end of file
whatsmars-motan/whatsmars-motan-provider/pom.xml
已删除
100644 → 0
浏览文件 @
67be3184
<?xml version="1.0" encoding="UTF-8"?>
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<parent>
<groupId>
org.hongxi
</groupId>
<artifactId>
whatsmars-motan
</artifactId>
<version>
1.0-SNAPSHOT
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<artifactId>
whatsmars-motan-provider
</artifactId>
<packaging>
jar
</packaging>
<name>
${project.artifactId}
</name>
<description>
The demo module of motan project
</description>
<properties>
<!-- The main class to start by executing java -jar -->
<start-class>
org.hongxi.whatsmars.motan.provider.App
</start-class>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-dependencies
</artifactId>
<version>
${spring-boot.version}
</version>
<type>
pom
</type>
<scope>
import
</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter
</artifactId>
</dependency>
<!--weibo motan-->
<dependency>
<groupId>
com.weibo
</groupId>
<artifactId>
motan-core
</artifactId>
<version>
${motan.version}
</version>
</dependency>
<dependency>
<groupId>
com.weibo
</groupId>
<artifactId>
motan-transport-netty
</artifactId>
<version>
${motan.version}
</version>
</dependency>
<dependency>
<groupId>
com.weibo
</groupId>
<artifactId>
motan-registry-consul
</artifactId>
<version>
${motan.version}
</version>
</dependency>
<dependency>
<groupId>
com.weibo
</groupId>
<artifactId>
motan-registry-zookeeper
</artifactId>
<version>
${motan.version}
</version>
</dependency>
<!-- dependencies blow were only needed for spring-based features -->
<dependency>
<groupId>
com.weibo
</groupId>
<artifactId>
motan-springsupport
</artifactId>
<version>
${motan.version}
</version>
</dependency>
<dependency>
<groupId>
org.hongxi
</groupId>
<artifactId>
whatsmars-motan-api
</artifactId>
<version>
1.0-SNAPSHOT
</version>
</dependency>
</dependencies>
<build>
<finalName>
${project.artifactId}
</finalName>
<resources>
<resource>
<directory>
src/main/resources
</directory>
<filtering>
true
</filtering>
</resource>
</resources>
<plugins>
<plugin>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-maven-plugin
</artifactId>
<dependencies>
<dependency>
<groupId>
org.springframework
</groupId>
<artifactId>
springloaded
</artifactId>
<version>
${springloaded.version}
</version>
</dependency>
</dependencies>
<!-- POM不是继承spring-boot-starter-parent的话,需要下面的指定 -->
<configuration>
<mainClass>
${start-class}
</mainClass>
<layout>
ZIP
</layout>
</configuration>
<executions>
<execution>
<goals>
<goal>
repackage
</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
\ No newline at end of file
whatsmars-motan/whatsmars-motan-provider/src/main/java/org/hongxi/whatsmars/motan/provider/App.java
已删除
100644 → 0
浏览文件 @
67be3184
package
org.hongxi.whatsmars.motan.provider
;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
import
org.springframework.context.annotation.ImportResource
;
@SpringBootApplication
@ImportResource
(
locations
={
"classpath*:spring/*server.xml"
})
public
class
App
{
public
static
void
main
(
String
[]
args
)
{
SpringApplication
.
run
(
App
.
class
,
args
);
}
}
\ No newline at end of file
whatsmars-motan/whatsmars-motan-provider/src/main/java/org/hongxi/whatsmars/motan/provider/MotanSwitcherRunner.java
已删除
100644 → 0
浏览文件 @
67be3184
package
org.hongxi.whatsmars.motan.provider
;
import
com.weibo.api.motan.common.MotanConstants
;
import
com.weibo.api.motan.util.MotanSwitcherUtil
;
import
org.springframework.boot.CommandLineRunner
;
import
org.springframework.core.annotation.Order
;
import
org.springframework.stereotype.Component
;
/**
* Created by shenhongxi on 2017/6/30.
*/
@Component
@Order
(
value
=
1
)
public
class
MotanSwitcherRunner
implements
CommandLineRunner
{
@Override
public
void
run
(
String
...
args
)
throws
Exception
{
// 在使用注册中心时要主动调用下面代码
MotanSwitcherUtil
.
setSwitcherValue
(
MotanConstants
.
REGISTRY_HEARTBEAT_SWITCHER
,
true
);
System
.
out
.
println
(
"provider started..."
);
}
}
whatsmars-motan/whatsmars-motan-provider/src/main/java/org/hongxi/whatsmars/motan/provider/resource/MotanDemoServiceImpl.java
已删除
100644 → 0
浏览文件 @
67be3184
/*
* Copyright 2009-2016 Weibo, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org.hongxi.whatsmars.motan.provider.resource
;
import
org.hongxi.whatsmars.motan.api.MotanDemoService
;
import
org.springframework.stereotype.Service
;
@Service
(
"motanDemoService"
)
public
class
MotanDemoServiceImpl
implements
MotanDemoService
{
public
String
hello
(
String
name
)
{
System
.
out
.
println
(
name
);
return
"Hello "
+
name
+
"!"
;
}
}
whatsmars-motan/whatsmars-motan-provider/src/main/resources/log4j.properties
已删除
100644 → 0
浏览文件 @
67be3184
#
# Copyright 2009-2016 Weibo, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
log4j.rootLogger
=
warn
log4j.logger.info
=
info,infofile
log4j.logger.warn
=
warn,warnfile
log4j.logger.error
=
error,errorfile
log4j.logger.profile
=
info,profile
log4j.logger.trace
=
trace,tracefile
log4j.logger.accessLog
=
debug,accessfile
log4j.logger.serviceStatsLog
=
info,serviceStatsLog
log4j.appender.tracefile
=
org.apache.log4j.DailyRollingFileAppender
log4j.appender.tracefile.file
=
./logs/server/trace.log
log4j.appender.tracefile.DatePattern
=
'.'yyyyMMdd
log4j.appender.tracefile.layout
=
org.apache.log4j.PatternLayout
log4j.appender.tracefile.layout.ConversionPattern
=
%-d{yyyy-MM-dd HH:mm:ss} [%p] %m%n
log4j.appender.accessfile
=
org.apache.log4j.DailyRollingFileAppender
log4j.appender.accessfile.file
=
./logs/server/access.log
log4j.appender.accessfile.DatePattern
=
'.'yyyyMMdd
log4j.appender.accessfile.layout
=
org.apache.log4j.PatternLayout
log4j.appender.accessfile.layout.ConversionPattern
=
%-d{yyyy-MM-dd HH:mm:ss} [%p] %m%n
log4j.appender.stdout
=
org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout
=
org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern
=
%p %d{yy/MM/dd HH:mm:ss} %-50.50c(%L) - %m%n
log4j.appender.infofile
=
org.apache.log4j.DailyRollingFileAppender
log4j.appender.infofile.file
=
./logs/server/info.log
log4j.appender.infofile.DatePattern
=
'.'yyyyMMdd-HH
log4j.appender.infofile.layout
=
org.apache.log4j.PatternLayout
log4j.appender.infofile.layout.ConversionPattern
=
%-d{yyyy-MM-dd HH:mm:ss} [%p] %m%n
log4j.appender.warnfile
=
org.apache.log4j.DailyRollingFileAppender
log4j.appender.warnfile.file
=
./logs/server/warn.log
log4j.appender.warnfile.DatePattern
=
'.'yyyyMMdd
log4j.appender.warnfile.layout
=
org.apache.log4j.PatternLayout
log4j.appender.warnfile.layout.ConversionPattern
=
%-d{yyyy-MM-dd HH:mm:ss} [%p] %m%n
log4j.appender.errorfile
=
org.apache.log4j.DailyRollingFileAppender
log4j.appender.errorfile.file
=
./logs/server/error.log
log4j.appender.errorfile.DatePattern
=
'.'yyyyMMdd
log4j.appender.errorfile.layout
=
org.apache.log4j.PatternLayout
log4j.appender.errorfile.layout.ConversionPattern
=
%-d{yyyy-MM-dd HH:mm:ss} [%p] %m%n
#profile
log4j.appender.profile
=
org.apache.log4j.DailyRollingFileAppender
log4j.appender.profile.file
=
./logs/server/profile.log
log4j.appender.profile.DatePattern
=
'.'yyyyMMdd-HH
log4j.appender.profile.layout
=
org.apache.log4j.PatternLayout
log4j.appender.profile.layout.ConversionPattern
=
%-d{yyyy-MM-dd HH:mm:ss} %m%n
#serviceStats
log4j.appender.serviceStatsLog
=
org.apache.log4j.DailyRollingFileAppender
log4j.appender.serviceStatsLog.file
=
./logs/server/serverserviceStatsLog.log
log4j.appender.serviceStatsLog.DatePattern
=
'.'yyyyMMdd
log4j.appender.serviceStatsLog.layout
=
org.apache.log4j.PatternLayout
log4j.appender.serviceStatsLog.layout.ConversionPattern
=
%-d{HH:mm:ss} %m%n
whatsmars-motan/whatsmars-motan-provider/src/main/resources/spring/motan_demo_server.xml
已删除
100644 → 0
浏览文件 @
67be3184
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright 2009-2016 Weibo, Inc.
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<beans
xmlns=
"http://www.springframework.org/schema/beans"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xmlns:motan=
"http://api.weibo.com/schema/motan"
xsi:schemaLocation=
"http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://api.weibo.com/schema/motan http://api.weibo.com/schema/motan.xsd"
>
<!-- 业务具体实现类 -->
<!--<bean id="motanDemoServiceImpl" class="com.weibo.motan.demo.service.impl.MotanDemoServiceImpl"/>-->
<!-- 注册中心配置 使用不同注册中心需要依赖对应的jar包。如果不使用注册中心,可以把check属性改为false,忽略注册失败。-->
<!--<motan:registry regProtocol="local" name="registry" />-->
<!--<motan:registry regProtocol="consul" name="registry" address="127.0.0.1:8500"/>-->
<motan:registry
regProtocol=
"zookeeper"
name=
"registry"
address=
"127.0.0.1:2181"
/>
<!-- 协议配置。为防止多个业务配置冲突,推荐使用id表示具体协议。-->
<motan:protocol
id=
"demoMotan"
default=
"true"
name=
"motan"
maxServerConnection=
"80000"
maxContentLength=
"1048576"
maxWorkerThread=
"800"
minWorkerThread=
"20"
/>
<!-- 通用配置,多个rpc服务使用相同的基础配置. group和module定义具体的服务池。export格式为“protocol id:提供服务的端口”-->
<motan:basicService
export=
"demoMotan:8002"
group=
"motan-demo-rpc"
accessLog=
"false"
shareChannel=
"true"
module=
"motan-demo-rpc"
application=
"myMotanDemo"
registry=
"registry"
id=
"serviceBasicConfig"
/>
<!-- 具体rpc服务配置,声明实现的接口类。-->
<motan:service
interface=
"org.hongxi.whatsmars.motan.api.MotanDemoService"
ref=
"motanDemoService"
export=
"demoMotan:8001"
basicService=
"serviceBasicConfig"
>
</motan:service>
<motan:service
interface=
"org.hongxi.whatsmars.motan.api.MotanDemoService"
ref=
"motanDemoService"
export=
"demoMotan:8002"
basicService=
"serviceBasicConfig"
>
</motan:service>
</beans>
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录