最后
毕竟工作也这么久了 ,除了途虎一轮,也七七八八面试了不少大厂,像阿里、饿了么、美团、滴滴这些面试过程就不一一写在这篇文章上了。我会整理一份详细的面试过程及大家想知道的一些问题细节
美团面试经验
字节面试经验
菜鸟面试经验
蚂蚁金服面试经验
唯品会面试经验
因篇幅有限,图文无法详细发出
从GitHub爬取项目教程如下:
使用 Git爬取 GitEE、GitLab、GitHub项目的教程
dubbo-admin采用前后端分离的形式管理项目
爬取文件如下
♨️部署dubbo-admin-server
运行后端项目必须启动 zookeeper,否则启动失败
cmd窗口进入dubbo-admin-server,执行以下命令
mvn clean package
打包部署项目
在这里等大概5分钟左右即可部署完成
部署完成后生成target目录
cmd窗口进入target目录执行以下命令
java -jar dubbo-admin-server-0.4.0.jar
后端项目运行成功~
♨️部署dubbo-admin-ui
在这里需要有 node 环境
教程如下
cmd窗口进入dubbo-admin-ui,执行以下命令下载依赖
npm install
下载完毕后,执行启动命令
npm run dev
启动成功
访问前端生成的本地地址
默认用户名密码均为root
输入即可登录成功
后端的地址必须和前端工程vue.config.js下的target路径一样,否则404!
七、SpringBoot 整合Dubbo + Zookeeper
===================================================================================================
基于SpringBoot项目整合Dubbo + Zookeeper 实现消费者消费服务提供者的服务
消费者为订单模块,传入用户id去查询用户模块的用户信息,实现远程RPC调用服务,分布式调用,而不是单体架构
服务提供者为用户模块,返回用户信息
-
父工程:dubbo-boot
-
公共API(接口及实体类):GmallPublicInterafce
-
服务提供者:UserServiceProvider
-
服务消费者:OrderServiceConsumer
🚃父级工程 dubbo-boot
pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<!-- 整体引入springboot工程 -->
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.5.5</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>org.example</groupId>
<artifactId>dubbo-boot</artifactId>
<packaging>pom</packaging>
<version>1.0-SNAPSHOT</version>
<!-- 子模块 -->
<modules>
<module>GmallPublicInterface</module>
<module>UserServiceProvider</module>
<module>OrderServiceConsumer</module>
</modules>
<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
</properties>
</project>
🚃公共API模块 GmallPublicInterface
pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>dubbo-boot</artifactId>
<groupId>org.example</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>GmallPublicInterface</artifactId>
<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
</properties>
<dependencies>
<!-- 引入dubbo -->
<!-- https://mvnrepository.com/artifact/com.alibaba/dubbo -->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>dubbo</artifactId>
<version>2.6.2</version>
</dependency>
<!-- 注册中心使用的是zookeeper,引入操作zookeeper的客户端 -->
<dependency>
<groupId>org.apache.curator</groupId>
<artifactId>curator-framework</artifactId>
<version>2.12.0</version>
</dependency>
<dependency>
<groupId>com.alibaba.boot</groupId>
<artifactId>dubbo-spring-boot-starter</artifactId>
<version>0.2.0</version>
</dependency>
</dependencies>
</project>
还有一些核心的接口及实体类
🚃服务提供者模块 UserServiceProvider
pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>dubbo-boot</artifactId>
<groupId>org.example</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>UserServiceProvider</artifactId>
<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
</properties>
<dependencies>
<dependency>
<groupId>org.example</groupId>
<artifactId>GmallPublicInterface</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
<resources>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.xml</include>
</includes>
<filtering>false</filtering>
</resource>
<resource>
<directory>src/main/resources</directory>
</resource>
<resource>
<directory>libs/</directory>
<targetPath>libs</targetPath>
<includes>
<include>**/*.jar</include>
</includes>
</resource>
</resources>
</build>
</project>
application.yml
# 配置端口号
server:
port: 8084
# 配置Dubbo
dubbo:
application:
name: UserServiceProvider
registry:
address: zookeeper://127.0.0.1:2181
protocol:
name: dubbo
port: 20881
monitor:
protocol: registry
consumer:
timeout: 2000
UserServiceImpl
package com.wanshi.service.impl;
import com.alibaba.dubbo.config.annotation.Service;
import com.wanshi.bean.UserAddress;
import com.wanshi.service.UserService;
import java.util.Arrays;
import java.util.List;
@Service
public class UserServiceImpl implements UserService {
@Override
public List<UserAddress> getUserAddressList(String userId) {
System.out.println("UserServiceImpl.....old...");
// TODO Auto-generated method stub
UserAddress address1 = new UserAddress(1, "北京市朝阳区", "1", "Bug 终结者", "010-5625321", "Y");
UserAddress address2 = new UserAddress(2, "北京市海淀区", "1", "小王", "010-66253834", "N");
return Arrays.asList(address1,address2);
}
}
🚃服务消费者模块 OrderServiceConsumer
pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>dubbo-boot</artifactId>
<groupId>org.example</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>OrderServiceConsumer</artifactId>
<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
</properties>
<dependencies>
<dependency>
<groupId>org.example</groupId>
<artifactId>GmallPublicInterface</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
<resources>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.xml</include>
</includes>
<filtering>false</filtering>
</resource>
<resource>
<directory>src/main/resources</directory>
</resource>
<resource>
<directory>libs/</directory>
<targetPath>libs</targetPath>
<includes>
<include>**/*.jar</include>
# Kafka实战笔记
> **关于这份笔记,为了不影响大家的阅读体验,我只能在文章中展示部分的章节内容和核心截图**
![image.png](https://img-blog.csdnimg.cn/img_convert/2cc85608d32d17d0310e38553cbf07da.webp?x-oss-process=image/format,png)
* **Kafka入门**
* **为什么选择Kafka**
* **Karka的安装、管理和配置**
![image.png](https://img-blog.csdnimg.cn/img_convert/09f9343baea30b89edb8f1253f7b813f.webp?x-oss-process=image/format,png)
* **Kafka的集群**
* **第一个Kafka程序**
* ![image.png](https://img-blog.csdnimg.cn/img_convert/56720cf082b0aa6a7cd907884921df91.webp?x-oss-process=image/format,png)
afka的生产者
![image.png](https://img-blog.csdnimg.cn/img_convert/37e6816a12e51cfc2d5d377dcbecc351.webp?x-oss-process=image/format,png)
* **Kafka的消费者**
* **深入理解Kafka**
* **可靠的数据传递**
![image.png](https://img-blog.csdnimg.cn/img_convert/5559791fcaf7563ba6c6365e8c2f695f.webp?x-oss-process=image/format,png)
![image.png](https://img-blog.csdnimg.cn/img_convert/1bda7817d9d754d718afa2247dde034f.webp?x-oss-process=image/format,png)
* **Spring和Kalka的整合**
* **Sprinboot和Kafka的整合**
* **Kafka实战之削峰填谷**
* **数据管道和流式处理(了解即可)**
![image.png](https://img-blog.csdnimg.cn/img_convert/f6131584380c287f1c9651417d4e7c93.webp?x-oss-process=image/format,png)
* **Kafka实战之削峰填谷**
![image.png](https://img-blog.csdnimg.cn/img_convert/337d207a899941b1dc357d9684f19843.webp?x-oss-process=image/format,png)
> **本文已被[CODING开源项目:【一线大厂Java面试题解析+核心总结学习笔记+最新讲解视频+实战项目源码】](https://bbs.csdn.net/forums/4f45ff00ff254613a03fab5e56a57acb)收录**
**[需要这份系统化的资料的朋友,可以点击这里获取](https://bbs.csdn.net/forums/4f45ff00ff254613a03fab5e56a57acb)**
-1715464417607)]
* **Kafka入门**
* **为什么选择Kafka**
* **Karka的安装、管理和配置**
[外链图片转存中...(img-SlTdTzZN-1715464417608)]
* **Kafka的集群**
* **第一个Kafka程序**
* [外链图片转存中...(img-C5BEhGsM-1715464417608)]
afka的生产者
[外链图片转存中...(img-v2Ih2tD4-1715464417608)]
* **Kafka的消费者**
* **深入理解Kafka**
* **可靠的数据传递**
[外链图片转存中...(img-jRZqhzxc-1715464417609)]
[外链图片转存中...(img-14D9sycd-1715464417609)]
* **Spring和Kalka的整合**
* **Sprinboot和Kafka的整合**
* **Kafka实战之削峰填谷**
* **数据管道和流式处理(了解即可)**
[外链图片转存中...(img-DTUnGM1c-1715464417609)]
* **Kafka实战之削峰填谷**
[外链图片转存中...(img-sEEkxw0c-1715464417610)]
> **本文已被[CODING开源项目:【一线大厂Java面试题解析+核心总结学习笔记+最新讲解视频+实战项目源码】](https://bbs.csdn.net/forums/4f45ff00ff254613a03fab5e56a57acb)收录**
**[需要这份系统化的资料的朋友,可以点击这里获取](https://bbs.csdn.net/forums/4f45ff00ff254613a03fab5e56a57acb)**