提交 6497c411 编写于 作者: 武汉红喜's avatar 武汉红喜

delete motan

上级 67be3184
......@@ -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)
......
......@@ -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>
......
https://github.com/weibocom/motan
\ No newline at end of file
<?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
<?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
package org.hongxi.whatsmars.motan.api;
/**
* Created by shenhongxi on 2017/6/29.
*/
public interface MotanDemoService {
String hello(String name);
}
<?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
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
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);
}
}
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...");
}
}
#
# 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
<?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>
<?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
<?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
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
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...");
}
}
/*
* 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 + "!";
}
}
#
# 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
<?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.
先完成此消息的编辑!
想要评论请 注册