dubbo服务者配置说明
<?xml version="1.0" encoding="UTF-8"?>
<!-- - Copyright 1999-2011 Alibaba Group. - - 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:dubbo="http://code.alibabatech.com/schema/dubbo"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://code.alibabatech.com/schema/dubbo http://code.alibabatech.com/schema/dubbo/dubbo.xsd"> <!-- 引入spring配置 -->
<import resource="applicationContext.xml" />
<!-- 具体服务实现bean -->
<bean id="userService" class="com.heli.user.service.impl.UserServiceImpl" />
<!-- 将服务service封装成可以对外开放的服务, 同时提供负载均衡算法,loadbalance可选有random,roundrobin(轮询) -->
<!--service中加入 mock="return null"当service所有都挂掉以后,client调用时自动获取到return null -->
<!--service中加入 actives="10" 表示限制所有服务在每个客户端调用都不能同时超过10个 -->
<!--service中加入 executes="10" 表示限制所有服务在每个服务器端被调用都不能同时超过10个 -->
<!-- 可以在service中加入内部标签 <dubbo:method name="sayHello" actives="10" />来控制每个方法的执行并发个数 -->
<!-- timeout="300" retry="2" 超时时间300 重试2次 -->
<!-- owner=”WangHeping,Guoyong”该服务的负责人 -->
<dubbo:service interface="com.heli.user.service.IUserService" ref="userService" loadbalance="roundrobin" />
<!-- 提供方应用信息,用于计算依赖关系,不要与消费方一样 -->
<dubbo:application name="MyFirstDubboProvider" />
<!-- 使用multicast广播注册中心暴露服务地址 <dubbo:registry address="multicast://224.5.6.7:1234"
/> -->
<!-- 使用zookeeper注册中心暴露服务地址 -->
<dubbo:registry address="zookeeper://192.168.1.244:2181" />
<!-- 用dubbo协议在20880端口暴露服务 ,注意不能与其他服务端口相同 -->
<!-- dispatcher all所有请求都发到线程池处理,threadpool fixed固定线程池大小,初始化后不进行伸缩,threads 线程池内线程个数 -->
<!-- <dubbo:protocol accesslog="true" />开启访问日志记录 -->
<!-- <dubbo:protocol accesslog="http://10.20.160.198/wiki/display/dubbo/foo/bar.log" />规定访问日志的路径 -->
<!-- <dubbo:protocol name="dubbo" connections="2" accepts="1000"/> dubbo协议使用长连接和nio,这里connections=2表示同时建立两个长连接(要在provier和consumer同时写上)
accepts=1000 表示为了防止同时过来大量连接而被干掉,限制最大为1000-->
<dubbo:protocol name="dubbo" port="20880" dispatcher="all" threadpool="fixed" threads="100" /> </beans>
dubbo服务者配置说明的更多相关文章
- Spring Boot Logback应用日志
e Spring Boot Logback应用日志 2015-09-08 19:57 7673人阅读 评论(0) 收藏 举报 . 分类: Spring Boot(51) . 目录(?)[+] 日志对于 ...
- Dubbo 2.7.1 踩坑记
Dubbo 2.7 版本增加新特性,新系统开始使用 Dubbo 2.7.1 尝鲜新功能.使用过程中不慎踩到这个版本的 Bug. 系统架构 Spring Boot 2.14-Release + Dubb ...
- Dubbo+Zookeeper的简单入门案例
1.1 Dubbo简介 Apache Dubbo是一款高性能的Java RPC框架.其前身是阿里巴巴公司开源的一个高性能.轻量级的开源Java RPC框架,可以和Spring框架无缝集成. 什么是R ...
- 10 Dubbo 配置实战
Dubbo 配置实战 快速入门 dubbo 建议看这篇文章是在学习了快速入门 dubbo 那篇文章的基础上来学习 配置说明 文档地址 https://dubbo.apache.org/zh/index ...
- Dubbo源码(六) - 服务路由
前言 本文基于Dubbo2.6.x版本,中文注释版源码已上传github:xiaoguyu/dubbo 今天,来聊点短的,服务路由Router,本文讲的是路由的调用路径,不讲路由的规则解析.想了解规则 ...
- ZooKeeper 相关概念以及使用小结
Dubbo 通过注册中心在分布式环境中实现服务的注册与发现,而注册中心通常采用 ZooKeeper,研究注册中心相关源码绕不开 ZooKeeper,所以学习了 ZooKeeper 的基本概念以及相关 ...
- Java自学路线图之Java框架自学
Java自学路线图的框架分为两个阶段,第一阶段的Java框架包含六个内容:MyBatis,Spring,SpringMVC,Maven高级,Git,Dubbo. 在Java自学过程中掌握框架的使用,对 ...
- k8s-2-集成apollo配置中心
主题: 在k8s中集成Apollo配置中心 架构图 一.配置中心概述 配置的几种方式 本课讲得是基于配置中心数据库实现 配置管理的现状 常见的配置中心 主讲:k8s configmap,apollo ...
- dubbo在idea下的使用创建 服务者,消费者 注册中心
1.基于windows 下 spring 下的dubbo 需要书写配置文件 (1).创建带有web工程的项目 创建一个服务者 package cn.edu.aynu.bean; import lo ...
随机推荐
- linux grep 指定字符串的正则表达式
cat all_uuid_log | grep "[a-z0-9]\{32\}"
- textarea中的空格与换行
当在一个textarea标签中键入一个回车时,实际上会插入2个符号:\n\r在javascript里, line breaks用\n表示when you pull text into Javascri ...
- Django Web开发【1】Django简介
前言 看完<Django Book>之后, 总想找个实例来实战开发下,无奈国内Django的书籍相当少,只能从英文书籍中吸取养料,偶然之后得到Learning Website Develo ...
- jquery中的uploadfile关于图片上上传的插件的应用
ajaxFileUpload是一个异步上传文件的jQuery插件. 传一个不知道什么版本的上来,以后不用到处找了. 语法:$.ajaxFileUpload([options]) options参数说明 ...
- phpstorm 同步远程服务器代码
1.打开view —Toolbar,点击红框中的小工具 2.单击Deployment,在connection中填写对应选项, 其中:type勾选sftp root path :点击后面的Autodet ...
- iOS 使用xib创建cell的两种初始化方式
曾几何时,被自己坑过,为了防止下次继续被自己坑,我决定了!在每个我能看到的地方,都把问题写一遍!!! 方法一: ? 1 2 3 4 第一步: [self.collectionView register ...
- Oracle 游标Cursor 的基本用法
查询 SELECT语句用于从数据库中查询数据,当在PL/SQL中使用SELECT语句时,要与INTO子句一起使用,查询的 返回值被赋予INTO子句中的变量,变量的声明是在DELCARE中.SELECT ...
- 查看ORACLE 数据库及表信息
-- 查看ORACLE 数据库中本用户下的所有表 SELECT table_name FROM user_tables; -- 查看ORACLE 数据库中所有用户下的所有表 select user,t ...
- http 响应头之location
<pre name="code" class="html">jrhmpt01:/root# cat login_yylc.pl use LWP::U ...
- CCNA实验(8) -- PPP & HDLC
HDLC帧格式与以太帧格式有很大差别,HDLC帧没有源MAC和目的MAC地址.HDLC不能提供验证,缺少对链路保护.Cisco设备与Cisco设备连接,可用HDLC封装.Cisco设备与非Cisco设 ...