当前位置: 首页 > news >正文

国贸附近网站建设seo搜索引擎入门教程

国贸附近网站建设,seo搜索引擎入门教程,三折页设计那个网站做的好,动漫设计速成班一、为什么要使用dubbo 1、dubbo是什么 dubbo是一个分布式服务框架,致力于提供高性能和透明化的RPC远程服务调用方案,以及SOA服务治理方案。 2、dubbo有何特点 (1)远程通讯:提供透明化的远程方法调用,提供…

一、为什么要使用dubbo

1、dubbo是什么
dubbo是一个分布式服务框架,致力于提供高性能和透明化的RPC远程服务调用方案,以及SOA服务治理方案。

2、dubbo有何特点
(1)远程通讯:提供透明化的远程方法调用,提供多协议支持。
(2)集群容错:软负载均衡,失败容错,地址路由,动态配置等集群支持。
(3)自动发现:基于注册中心目录服务,使服务消费方能动态的查找服务提供方,支持平滑减少或增加机器。

3、为什么要使用dubbo
(1)刚起步,技术人员3个,springmvc
一个应用,一个数据库
(2)发展一年,技术人员10个,1个架构师,RPC
将独立的业务抽取出来,形成独立的服务(商品,订单,交易)
多个应用,多个数据库
(3)发展一年半,技术人员80个,服务越来越多,SOA
需要服务自动发现和治理,dubbo、spring cloud、ICE

4、MVC、RPC、SOA的架构如何演进
刚开始直接把系统做出来,推向市场,市场反应好了再改进

5、dubbo与spring cloud、ICE的区别
dubbo2是netty长连接

二、dubbo常用标签

1、application
描述:应用信息,就是当前服务的项目信息配置
特殊说明:无

2、container
描述:服务的运行容器
特殊说明:jetty、log4j、logback、spring

3、provider
描述:服务提供方的一些服务治理、性能调优的一些配置
特殊说明:该标签为当前服务的所有service和protocol标签的缺省值设置

4、service
描述:服务提供者暴露接口配置
特殊说明:无

5、consumer
描述:服务消费方的一些服务治理、性能调优的一些配置
特殊说明:无

6、reference
描述:服务消费者引用接口配置
特殊说明:无

7、registry
描述:注册中心配置
特殊说明:如果有多个不同的注册中心,可以声明多个registry标签,并在service或protocol的registry属性指定使用的注册中心

8、protocol
描述:远程调用协议dubbo、hessian、http、injvm、memcached、redis、rmi、thrift、webservice等
特殊说明:如果需要支持多协议,可以声明多个protocol标签,并在service中通过protocol属性指定使用协议

三、dubbo 3.0入门例子

1、下载官方入门例子
git clone --depth=1 --branch master git@github.com:apache/dubbo-samples.git

2、eclipse打开,只保留1-basic和tools模块,否则项目太多了

    <modules><module>1-basic</module><!--<module>2-advanced</module>--><!--<module>3-extensions</module>--><!--<module>4-governance</module>--><!--<module>10-task</module>--><!--<module>99-integration</module>--><module>tools</module></modules>

3、启动一个简易zookeeper
运行tools/embedded-zookeeper下的EmbeddedZooKeeper.java

/** Licensed to the Apache Software Foundation (ASF) under one or more* contributor license agreements.  See the NOTICE file distributed with* this work for additional information regarding copyright ownership.* The ASF licenses this file to You 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.apache.dubbo.samples;import java.io.File;
import java.util.Properties;
import java.util.UUID;import org.apache.zookeeper.server.ServerConfig;
import org.apache.zookeeper.server.ZooKeeperServerMain;
import org.apache.zookeeper.server.quorum.QuorumPeerConfig;public class EmbeddedZooKeeper {public static void main(String[] args) throws Exception {int port = 2181;if (args.length == 1) {port = Integer.parseInt(args[0]);}Properties properties = new Properties();File file = new File(System.getProperty("java.io.tmpdir")+ File.separator + UUID.randomUUID());file.deleteOnExit();properties.setProperty("dataDir", file.getAbsolutePath());properties.setProperty("clientPort", String.valueOf(port));QuorumPeerConfig quorumPeerConfig = new QuorumPeerConfig();quorumPeerConfig.parseProperties(properties);ZooKeeperServerMain zkServer = new ZooKeeperServerMain();ServerConfig configuration = new ServerConfig();configuration.readFrom(quorumPeerConfig);try {zkServer.runFromConfig(configuration);} catch (Exception e) {e.printStackTrace();System.exit(1);}}
}

4、启动服务提供者
运行1-basic/dubbo-samples-api下的org.apache.dubbo.samples.provider包内的Application.java

/** Licensed to the Apache Software Foundation (ASF) under one or more* contributor license agreements.  See the NOTICE file distributed with* this work for additional information regarding copyright ownership.* The ASF licenses this file to You 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.apache.dubbo.samples.provider;import org.apache.dubbo.config.ProtocolConfig;
import org.apache.dubbo.config.RegistryConfig;
import org.apache.dubbo.config.ServiceConfig;
import org.apache.dubbo.config.bootstrap.DubboBootstrap;
import org.apache.dubbo.samples.api.GreetingsService;public class Application {private static final String ZOOKEEPER_HOST = System.getProperty("zookeeper.address", "127.0.0.1");private static final String ZOOKEEPER_PORT = System.getProperty("zookeeper.port", "2181");private static final String ZOOKEEPER_ADDRESS = "zookeeper://" + ZOOKEEPER_HOST + ":" + ZOOKEEPER_PORT;public static void main(String[] args) {ServiceConfig<GreetingsService> service = new ServiceConfig<>();service.setInterface(GreetingsService.class);service.setRef(new GreetingsServiceImpl());DubboBootstrap.getInstance().application("first-dubbo-provider").registry(new RegistryConfig(ZOOKEEPER_ADDRESS)).protocol(new ProtocolConfig("dubbo", -1)).service(service).start().await();}
}

5、启动服务消费者
运行1-basic/dubbo-samples-api下的org.apache.dubbo.samples.client包内的AlwaysApplication.java

/** Licensed to the Apache Software Foundation (ASF) under one or more* contributor license agreements.  See the NOTICE file distributed with* this work for additional information regarding copyright ownership.* The ASF licenses this file to You 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.apache.dubbo.samples.client;import java.io.IOException;
import java.util.Date;import org.apache.dubbo.config.ReferenceConfig;
import org.apache.dubbo.config.RegistryConfig;
import org.apache.dubbo.config.bootstrap.DubboBootstrap;
import org.apache.dubbo.samples.api.GreetingsService;public class AlwaysApplication {private static final String ZOOKEEPER_HOST = System.getProperty("zookeeper.address", "127.0.0.1");private static final String ZOOKEEPER_PORT = System.getProperty("zookeeper.port", "2181");private static final String ZOOKEEPER_ADDRESS = "zookeeper://" + ZOOKEEPER_HOST + ":" + ZOOKEEPER_PORT;public static void main(String[] args) throws IOException {ReferenceConfig<GreetingsService> reference = new ReferenceConfig<>();reference.setInterface(GreetingsService.class);DubboBootstrap.getInstance().application("first-dubbo-consumer").registry(new RegistryConfig(ZOOKEEPER_ADDRESS)).reference(reference).start();GreetingsService service = reference.get();while (true) {try {String message = service.sayHi("dubbo");System.out.println(new Date() + " Receive result ======> " + message);Thread.sleep(1000);} catch (Throwable t) {t.printStackTrace();}}}}

6、打印日志

Wed Mar 08 17:05:04 CST 2023 Receive result ======> hi, dubbo
Wed Mar 08 17:05:05 CST 2023 Receive result ======> hi, dubbo
Wed Mar 08 17:05:06 CST 2023 Receive result ======> hi, dubbo
Wed Mar 08 17:05:07 CST 2023 Receive result ======> hi, dubbo
Wed Mar 08 17:05:08 CST 2023 Receive result ======> hi, dubbo
......

http://www.ds6.com.cn/news/57127.html

相关文章:

  • 金华网站建设公司哪个好宁德市人力资源和社会保障局
  • 电商网站建设的内容seoheuni
  • 做淘宝差不多的网站吗新东方线下培训机构官网
  • wordpress时间文件夹郑州seo竞价
  • wordpress 添加导航菜单长沙网站seo诊断
  • 沂源手机网站建设公司seo网站推广助理
  • 哈尔滨网站建设方案外包如何制作网站和网页
  • 进京服务的链接seo是做什么工作的
  • 做网站 服务器价格网店推广方案
  • 做网站放广告赚钱网上营销网站
  • 网站响应度谷歌站长平台
  • wordpress the_tags()网络推广优化
  • 豆各庄做网站的公司2024年8月爆发新的大流行病毒吗
  • 国外b站推广2024mmm网站建设 全网营销
  • 做动态效果的插件网站站长之家最新网站
  • 太原网站制作价格网站客服系统
  • 网站做动态图片大全seo综合查询站长工具关键词
  • 安徽做网站公司哪家好网站网络推广运营
  • 做网站制作赚钱吗百度问答一天能赚100块吗
  • 公司建设网站的作用市场营销是做什么的
  • cms网站开发涉及的知识长沙关键词优化平台
  • 精品课程网站建设论文福州百度推广电话
  • 公司网站建设升上去百度站长收录提交入口
  • asp做的网站seo经验
  • 杂志制作 wordpress主题公司的seo是什么意思
  • 做网站用的软件百度关键词规划师入口
  • ps怎么做网站首页和超链接男生最喜欢的浏览器
  • 网站怎么挂广告网站排名top排行榜
  • 如何备份网站数据网络营销ppt案例
  • 建设网站工作报告桂平seo快速优化软件