HW--DSF服务配置文件
集群配置,指定向哪个zookeeper注册服务
<?xml version="1.0" encoding="utf-8"?> <cluster> <!-- 服务器地址 <connector name="DsfZKClient" url="221.226.48.130:3655/4960 192.168.12.211:6830:2181" --> <!-- 服务器地址 --> <connector name="DsfZKClient" url="192.168.12.211:6830" retry-times="5" retry-interval-millisecond="5000" connect-timeout-millisecond="3000" session-timeout-millisecond="300000"> </connector> <nodes name="dsf" connector="DsfZKClient"> <node path="/dsf" cache="false" /> </nodes> </cluster>
服务提供方的配置
############################################ # DSF Core Configuration ############################################ # dsf app name, keep unique in distributed system dsf.appname=sync-server # dsf global service timeout in millis dsf.service.timeout=1000000 # core size for dsf handle service request thread pool dsf.worker.core.size=8 # max size for dsf handle service request thread pool dsf.worker.max.size=20 # queue size for dsf handler service request thread pool dsf.worker.queues=1000 logTraceSwitch=true ############################################ # DSF Fail Policy Configuration ############################################ # dsf request fail policy dsf.service.failpolicy=failover ############################################ # DSF Fail Over Policy Configuration ############################################ dsf.resend.times=3 # dsf timeout configuraion dsf.client.request.resend.interval=5 dsf.client.request.resend.times=0 ############################################ # DSF Registry Configuration ############################################ dsf.registry.name=zk dsf.registry.default=zk ############################################ # DSF ZK Registry Configuration ############################################ dsf.registry.zk.type=zookeeper dsf.registry.zk.connector=DsfZKClient ############################################ # DSF Protocol Configuration ############################################ dsf.protocol.name=dsf dsf.protocol.default=dsf ############################################ #dsf statistics center switch #default: false ############################################ dsf.statistics.switch=false ############################################ # DSF TCP Protocol Configuration ############################################ # dsf tcp protocol type dsf.protocol.tcp.type=dsf # dsf tcp protocol listen address dsf.protocol.tcp.address=10.211.95.145:20015 # max size for dsf tcp protocol acceptor thread pool dsf.protocol.tcp.threads=10 # queue size for dsf tcp protocol acceptor thread pool dsf.protocol.tcp.accepts=100 # max size for dsf tcp protocol io thread pool dsf.protocol.tcp.iothreads=20 # queue size for dsf tcp protocol io thread pool dsf.protocol.tcp.queues=100000 # async request waiting quque size for dsf tcp protocol dsf.protocol.tcp.async.queues=100000 # determine whether dsf tcp protocol iplimit enabled dsf.protocol.tcp.iplimit.enable=false # dsf tcp protocol iplimit whiltelist #dsf.protocol.tcp.iplimit.whitelist=* # dsf tcp protocol iplimit blacklist #dsf.protocol.tcp.iplimit.blacklist= # dsf tcp protocol heartbeat interval in seconds dsf.protocol.tcp.heartbeat.interval=5 # dsf tcp protocol heartbeat lost count dsf.protocol.tcp.heartbeat.lostcount=5 # max size for dsf tcp protocol client io thread pool dsf.protocol.tcp.client.iothreads=1 # queue size for dsf tcp protocol client io thread pool dsf.protocol.tcp.client.queues=100000 # dsf tcp protocol client reconnect interval in seconds dsf.protocol.tcp.client.reconnect.interval=3 # dsf tcp protocol client first connect wait time in millis dsf.protocol.tcp.client.connect.firstwait=2000 ############################################ # DSF Statistic Configuration ############################################ dsf.statistic.delay.enable=false ############################################ # DSF Monitor Configuration ############################################ # dsf time delay monitor time interval in seconds dsf.monitor.time.interval=5 ############################################ # DSF Default Route Policy ############################################ dsf.router.default=serviceDelayTimeRouter dsf.router.poll.localpriority=false ############################################ # DSF Default trace switch ############################################ dsf.trace.switch=true dsf.sampleRate=1
生产者 上传配置
<?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" xmlns:jee="http://www.springframework.org/schema/jee" xmlns:tx="http://www.springframework.org/schema/tx" xmlns:aop="http://www.springframework.org/schema/aop" xmlns:util="http://www.springframework.org/schema/util" xmlns:dsf="http://www.huawei.com/schema/dsf" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd http://www.springframework.org/schema/jee http://www.springframework.org/schema/data/jpa/spring-jee.xsd http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd http://www.huawei.com/schema/dsf http://www.huawei.com/schema/dsf/spring-dsf.xsd" default-lazy-init="false"> <description>migu-epower server</description> <!-- 注册AutowiredAnnotationBeanPostProcessor、CommonAnnotationBeanPostProcessor、PersistenceAnnotationBeanPostProcessor、RequiredAnnotationBeanPostProcessor --> <context:annotation-config/> <import resource="../spring-common.xml"/> <!-- local development环境 --> <beans profile="dev"> <context:property-placeholder ignore-resource-not-found="false" location="classpath:config/dev/config.properties" /> <!-- Tomcat JDBC连接池 --> <bean id="dataSource" class="org.apache.tomcat.jdbc.pool.DataSource" destroy-method="close"> <property name="driverClassName" value="${jdbc.driver}" /> <property name="url" value="${jdbc.url}" /> <property name="username" value="${jdbc.username}" /> <property name="password" value="${jdbc.password}" /> <property name="defaultAutoCommit" value="false" /> </bean> </beans> </beans>
消费者 调用配置
<?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:p="http://www.springframework.org/schema/p" xmlns:util="http://www.springframework.org/schema/util" xmlns:dsf="http://www.huawei.com/schema/dsf" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd http://www.huawei.com/schema/dsf http://www.huawei.com/schema/dsf/spring-dsf.xsd"> <description>migu-epower client</description> <!-- 内容中心:实体书查询服务 --> <dsf:importer name="epower.api.content.service.PaperBookQueryServiceFacade" interface="com.neusoft.epower.api.content.service.PaperBookQueryServiceFacade" service-name="epower.api.content.service.PaperBookQueryServiceFacade" protocol="dsf"> </dsf:importer> </beans>