IT行业均薪领跑7大传统行业
去年各行业月收入对比
今年IT各技术方向行业平均薪资
IT培训网面向所有课程学员提供先就业后付款学习方案,保证学员稳定就业,可谓0学费!免除学习压力。
正文:
Dubbo实现调用步骤分析,Dubbo作为一个RPC框架,其最核心的功能就是要实现跨网络的远程调用。本文将要创建一个应用,即作为服务的提供方,通过Dubbo来实现服务消费方远程调用服务提供方的方法。下面一起来看服务提供方开发的步骤吧~
1、创建maven工程(打包方式为war)dubbodemo_provider,在pom.xml文件中导入如下坐标
~~~xml
UTF-8
1.8
1.8
5.0.5.RELEASE
org.springframework
spring-context
${spring.version}
org.springframework
spring-beans
${spring.version}
org.springframework
spring-webmvc
${spring.version}
org.springframework
spring-jdbc
${spring.version}
org.springframework
spring-aspects
${spring.version}
org.springframework
spring-jms
${spring.version}
org.springframework
spring-context-support
${spring.version}
com.alibaba
dubbo
2.6.0
org.apache.zookeeper
zookeeper
3.4.7
com.github.sgroschupf
zkclient
0.1
javassist
javassist
3.12.1.GA
com.alibaba
fastjson
1.2.47
org.apache.maven.plugins
maven-compiler-plugin
2.3.2
1.8
1.8
org.apache.tomcat.maven
tomcat7-maven-plugin
8081
/
~~~
2、配置web.xml文件
~~~xml
"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd" >
Archetype Created Web Application
contextConfigLocation
classpath:applicationContext*.xml
org.springframework.web.context.ContextLoaderListener
~~~
3、创建服务接口
~~~java
package com.itheima.service;
public interface HelloService {
public String sayHello(String name);
}
~~~
4、创建服务实现类
~~~java
package com.itheima.service.impl;
import com.alibaba.dubbo.config.annotation.Service;
import com.itheima.service.HelloService;
@Service
public class HelloServiceImpl implements HelloService {
public String sayHello(String name) {
return "hello " + name;
}
}
~~~
注意:服务实现类上使用的Service注解是Dubbo提供的,用于对外发布服务
5、在src/main/resources下创建applicationContext-service.xml
~~~xml
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:dubbo="http://code.alibabatech.com/schema/dubbo"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc.xsd
http://code.alibabatech.com/schema/dubbo
http://code.alibabatech.com/schema/dubbo/dubbo.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd">
~~~
6、启动服务
tomcat7:run
以上就是Dubbo实现调用的步骤分析,大家都看懂了吗?如果对这一章还有什么疑问,可以在下方申请试学名额,报名学习在线视频课程,还有在线老师对你提供一对一指导的帮助~
姓名:左*飞
学历:专科
专业:理学与信息科学学院
薪资:13000
入职单位:北京惠信数据
数据来自学员真实就业
拒绝以偏概全
| 姓名 | 学历 | 入职单位 | 专业 | 薪水 | 福利 |
| 刘*东 | 专科 | 保密 | 信息工程系 | 12000 | 五险一金 |
| 刘*东 | 专科 | 保密 | 信息工程系 | 12000 | 五险一金 |
| 刘*东 | 专科 | 保密 | 信息工程系 | 12000 | 五险一金 |
Dubbo实现调用步骤汇总!
在乎每一位学员的职业梦想,坚持教育初心
| 20000名 年培养学员 |
5000名 同期在校学员 |
16城 培训中心遍布全国 |
20个 开设培训中心 |
| 500所 合作院校 |
10000家 合作企业 |
12门 目前开设课程 |
200位 讲师团队 |
· 就业保障体系覆盖全国,
· 10000多家合作企业定期招聘,
· 学员就业可随心选择。
· 全国各校区讲师统一管理,招聘标准一致,
· 课程大纲全范围内定期升级更新,
· 保障学员学习质量