• Duboo入门示例(Idea开发环境)


    在学习Dubbo分布式框架时的官方入门例子,很有代表性。简单清晰。
    有关Dubbo的概念、概述和简单的配置文件,可以看官方文档的简述
    会很快对Duboo有个整体的概念。


    准备工作:

    首先完成Zookeeper的安装配置


    • 解压后,在conf目录下增加一个zoo.cfg;
    • 用记事本打开简单配置一下:
    # The number of milliseconds of each tick  
    tickTime=2000  
    # The number of ticks that the initial   
    # synchronization phase can take  
    initLimit=10  
    # The number of ticks that can pass between   
    # sending a request and getting an acknowledgement  
    syncLimit=5  
    # the directory where the snapshot is stored.  
    dataDir=D:\zookeeper-3.4.12\data  
    dataDirLog=D:\zookeeper-3.4.12\log  
    # the port at which the clients will connect  
    clientPort=2181  
    • 根据你上述配置的目录(dataDir、dataDirLog),在根目录中新建它们。
    • 点击bin目录下的zkServer.cmd启动


    项目配置运行

    • 打开项目
    • 项目是Maven管理的多模块项目,首先引入多模块。

    • 找到我们演示的Demo项目

    • 将consumer和provider模块的xml下的注册中心配置全都换成ZooKeeper

      参数用途简介
    • 先运行Provider.java,再运行Consumer.java(确保打开了Zookeeper注册中心)
    • 运行效果图

      Consumer不断调用Provider提供的实现类,所呈现出的效果。
  • 相关阅读:
    Vue中发送HTTP请求
    Vuex
    vue-cli
    Vue基础2
    Vue基础1
    webpack_vue
    前言:数据库典型架构实践
    MySQL数据库优化
    解析 PHP 中 session 的实现原理以及大网站应用应该注意的问题
    Yii2.0 下的 load() 方法的使用
  • 原文地址:https://www.cnblogs.com/jpfss/p/9269405.html
Copyright © 2020-2023  润新知