<?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服务者配置说明的更多相关文章

  1. Spring Boot Logback应用日志

    e Spring Boot Logback应用日志 2015-09-08 19:57 7673人阅读 评论(0) 收藏 举报 . 分类: Spring Boot(51) . 目录(?)[+] 日志对于 ...

  2. Dubbo 2.7.1 踩坑记

    Dubbo 2.7 版本增加新特性,新系统开始使用 Dubbo 2.7.1 尝鲜新功能.使用过程中不慎踩到这个版本的 Bug. 系统架构 Spring Boot 2.14-Release + Dubb ...

  3. Dubbo+Zookeeper的简单入门案例

    1.1  Dubbo简介 Apache Dubbo是一款高性能的Java RPC框架.其前身是阿里巴巴公司开源的一个高性能.轻量级的开源Java RPC框架,可以和Spring框架无缝集成. 什么是R ...

  4. 10 Dubbo 配置实战

    Dubbo 配置实战 快速入门 dubbo 建议看这篇文章是在学习了快速入门 dubbo 那篇文章的基础上来学习 配置说明 文档地址 https://dubbo.apache.org/zh/index ...

  5. Dubbo源码(六) - 服务路由

    前言 本文基于Dubbo2.6.x版本,中文注释版源码已上传github:xiaoguyu/dubbo 今天,来聊点短的,服务路由Router,本文讲的是路由的调用路径,不讲路由的规则解析.想了解规则 ...

  6. ZooKeeper 相关概念以及使用小结

    Dubbo 通过注册中心在分布式环境中实现服务的注册与发现,而注册中心通常采用 ZooKeeper,研究注册中心相关源码绕不开 ZooKeeper,所以学习了 ZooKeeper 的基本概念以及相关 ...

  7. Java自学路线图之Java框架自学

    Java自学路线图的框架分为两个阶段,第一阶段的Java框架包含六个内容:MyBatis,Spring,SpringMVC,Maven高级,Git,Dubbo. 在Java自学过程中掌握框架的使用,对 ...

  8. k8s-2-集成apollo配置中心

    主题: 在k8s中集成Apollo配置中心 架构图 一.配置中心概述 配置的几种方式 本课讲得是基于配置中心数据库实现 配置管理的现状 常见的配置中心 主讲:k8s configmap,apollo ...

  9. dubbo在idea下的使用创建 服务者,消费者 注册中心

    1.基于windows 下  spring 下的dubbo  需要书写配置文件 (1).创建带有web工程的项目 创建一个服务者 package cn.edu.aynu.bean; import lo ...

随机推荐

  1. 遍历GridView

    ].Text+"--------------");                }            }

  2. 使用Spire PDF for .NET将HTML转换成PDF文档

    目录 开发环境说明 Spire PDF for .NET (free edition)体验 资源下载 开发环境说明 Microsoft Visual Studio 2013 Ultimate Edit ...

  3. 在Prefetcher中取消robots.txt的限制

    Robots.txt是一种专门用于搜索引擎网络爬虫的文件,当构造一个网站时,如果作者希望该网站的内容被搜索引擎收录,就可以在网站中创建一个纯文本文件robots.txt,在这个文件中,声明该网站不想被 ...

  4. ViewPager引导

    1.首先要导入android-support.v4.jar第三方工具包 2.activity_guid.xml <RelativeLayout xmlns:android="http: ...

  5. access 语句错误

    一直说是语句错误,一直没有找出来是什么错误,原来access的语句需要在字段上套一个[],这是最正确的写法,关键是动软生成的是我们一贯用的,和标准还是有些差别的,害了我好久都不知道是哪里的问题

  6. 【原创】重绘winform的GroupBox

    功能:重绘winform的GroupBox,以便调整边框颜色和边框宽度 using System; using System.Collections.Generic; using System.Com ...

  7. Highchart 改编风力风向图

    基于highchart修改而成的风力风向图 1.替换highchart.js drawpoints方法,替换内容如下: drawPoints: function() { var a, b = this ...

  8. IOS 特定于设备的开发:处理基本方向

    UIDevice类使用内置的orientation属性获取设备的物理方向.IOS设备支持这个属性的7个可能的值. >UIDeviceOrientationUnknown:方向目前未知. > ...

  9. SVN权限配置

    初始化SVN仓库后,里面有以下文件. 其中conf是对授权.认证进行管理的,conf目录里的内容有: passwd设立账户密码: authz权限管理: 假设pwd里有user1,user2两个账户 @ ...

  10. SQL Server 数据岸问题

    create table t2(x int constraint pk_t2 primary key);go insert into t2(x) values(1),(2),(3),(5),(7),( ...