国产 无码 综合区,色欲AV无码国产永久播放,无码天堂亚洲国产AV,国产日韩欧美女同一区二区

最新版 !快速掌握JDK17 + springboot3 + springcloud Alibaba : 1、 微服務環(huán)境搭建

這篇具有很好參考價值的文章主要介紹了最新版 !快速掌握JDK17 + springboot3 + springcloud Alibaba : 1、 微服務環(huán)境搭建。希望對大家有所幫助。如果存在錯誤或未考慮完全的地方,請大家不吝賜教,您也可以點擊"舉報違法"按鈕提交疑問。

最新版 !快速掌握JDK17 + springboot3 + springcloud Alibaba 專欄
2、服務治理 Nacos Discovery
3、遠程調用負載均衡 Ribbon
4、遠程調用Feign
5、服務熔斷降級 Sentinel

源碼

1 一些說明

為了方便講解SpringCloud課程,我們以最常見的電商項目2個核心模塊:商品模塊、訂單模塊為例子,一一講解SpringCloud組件的使用。

學習SpringCloud組件要訣:

1>能解決啥問題

2>怎么解決(理解原理)

3>API調用(代碼怎么寫)–建議寫3遍–【1遍抄全,2遍思考,3遍掌握】

4>總結,開口表述

5>類比以前代碼結構

微服務-----完整項目按功能分類拆分成n個子項目/子模塊,這些子模塊能對外提供對應的功能。我們稱這些服務為微服務

落地到代碼:單看子項目,每個子項目就是一個完整項目(springmvc項目)----記住沒啥高大上的

商品微服務

  • 對外提供查詢商品列表接口
  • 對外提供查詢某個商品信息接口

訂單微服務

  • 對外提供創(chuàng)建訂單接口

服務調用

在微服務架構中,最常見的場景就是微服務之間的相互調用。以下單為例子:客戶向訂單微服務發(fā)起一個下單的請求,在進行保存訂單之前需要調用商品微服務查詢商品的信息。

最新版 !快速掌握JDK17 + springboot3 + springcloud Alibaba : 1、 微服務環(huán)境搭建,springcloud Alibaba,spring Cloud,微服務,java,spring boot

一般把調用方稱為服務消費者,把被調用方稱為服務提供者。

上例中,訂單微服務就是服務消費者, 而商品微服務是服務提供者。

2 技術選型

JDK17

持久層: MyBatis-Plus

數(shù)據(jù)庫: MySQL5.7

其他: SpringCloud Alibaba 技術棧

服務注冊與發(fā)現(xiàn):Nacos 
分布式事務:Seata
網(wǎng)關:Spring Cloud Gateway
服務調用:OpenFeign
鑒權:Spring Authorization Server 、Oauth2.1
消息隊列:rocketmq
限流、熔斷:sentinel
鏈路追蹤:Micrometer Tracing
接口文檔:knife4j

3 模塊設計

— shop-parent 父工程

? — shop-product-api 商品微服務api 【存放商品實體】

? — shop-product-server 商品微服務 【端口:808x】

? — shop-order-api 訂單微服務api 【存放訂單實體】

? — shop-order-server 訂單微服務 【端口:809x】

最新版 !快速掌握JDK17 + springboot3 + springcloud Alibaba : 1、 微服務環(huán)境搭建,springcloud Alibaba,spring Cloud,微服務,java,spring boot

shop-product-server:子項目-商品微服務,對外提供查詢商品信息的接口

shop-order-server:子項目-訂單微服務,對外提供創(chuàng)建訂單的接口

shop-product-api / shop-order-api : 各自微服務依賴的實體類,為啥要拆開?答案是:解耦

4 版本說明

? https://github.com/alibaba/spring-cloud-alibaba/wiki/版本說明
最新版 !快速掌握JDK17 + springboot3 + springcloud Alibaba : 1、 微服務環(huán)境搭建,springcloud Alibaba,spring Cloud,微服務,java,spring boot

5 創(chuàng)建父工程

創(chuàng)建 shop-parent 一個maven工程,然后在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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>3.0.2</version>
        <relativePath/> <!-- lookup parent from repository -->
    </parent>
    <groupId>com.example</groupId>
    <artifactId>shop</artifactId>
    <version>1.0.0</version>
    <name>shop-parent</name>
    <packaging>pom</packaging>

    <modules>
        <module>shop-product-api</module>
        <module>shop-product-server</module>
    </modules>

    <properties>
        <java.version>17</java.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <spring-cloud.version>2022.0.0</spring-cloud.version>
        <spring-cloud-alibaba.version>2022.0.0.0-RC2</spring-cloud-alibaba.version>
    </properties>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-dependencies</artifactId>
                <version>${spring-cloud.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>

            <dependency>
                <groupId>com.alibaba.cloud</groupId>
                <artifactId>spring-cloud-alibaba-dependencies</artifactId>
                <version>${spring-cloud-alibaba.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

</project>

6 創(chuàng)建商品微服務

6.1 創(chuàng)建shop-product-api項目,然后在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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>com.example</groupId>
        <artifactId>shop</artifactId>
        <version>1.0.0</version>
    </parent>
    <artifactId>shop-product-api</artifactId>
    <version>1.0.0</version>
    <packaging>jar</packaging>

    <properties>
        <java.version>17</java.version>
    </properties>
    <dependencies>
        <dependency>
            <groupId>com.baomidou</groupId>
            <artifactId>mybatis-plus-boot-starter</artifactId>
            <version>3.5.3.1</version>
        </dependency>
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
        </dependency>
    </dependencies>

</project>

6.2 創(chuàng)建實體類

package com.example.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import java.io.Serializable;

//商品
@Getter
@Setter
@ToString
@TableName("t_product")
public class Product implements Serializable {
    //主鍵
    @TableId(type= IdType.AUTO)
    private Long id;
    //商品名稱
    private String name;
    //商品價格
    private Double price;
    //庫存
    private Integer stock;
}


6.3 創(chuàng)建shop-product-server項目,然后在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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>com.example</groupId>
        <artifactId>shop</artifactId>
        <version>1.0.0</version>
    </parent>
    <artifactId>shop-product-server</artifactId>
    <version>1.0.0</version>

    <properties>
        <java.version>17</java.version>
    </properties>
    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
        </dependency>

        <dependency>
            <groupId>com.alibaba</groupId>
            <artifactId>fastjson</artifactId>
            <version>2.0.32</version>
        </dependency>
        <dependency>
            <groupId>com.example</groupId>
            <artifactId>shop-product-api</artifactId>
            <version>1.0.0</version>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
        </plugins>
    </build>

</project>

6.4 編寫配置文件application.yml

server:
  port: 8081
spring:
  application:
    name: product-service
  datasource:
    driver-class-name: com.mysql.cj.jdbc.Driver
    url: jdbc:mysql://localhost:3306/shop-product?serverTimezone=UTC&useUnicode=true&characterEncoding=utf-8&useSSL=true
    username: root
    password: aaaaaa

6.5 在數(shù)據(jù)庫中創(chuàng)建shop-product的數(shù)據(jù)庫

CREATE TABLE `t_product` (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主鍵',
  `name` varchar(255) DEFAULT NULL COMMENT '商品名稱',
  `price` double(10,2) DEFAULT NULL COMMENT '商品價格',
  `stock` int DEFAULT NULL COMMENT '庫存',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
INSERT INTO t_product VALUE(NULL,'小米','1000','5000'); 
INSERT INTO t_product VALUE(NULL,'華為','2000','5000'); 
INSERT INTO t_product VALUE(NULL,'蘋果','3000','5000'); 
INSERT INTO t_product VALUE(NULL,'OPPO','4000','5000');

6.6 創(chuàng)建ProductMapper

package com.example.server.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.domain.Product;

public interface ProductMapper extends BaseMapper<Product> {
}

6.7 創(chuàng)建ProductService接口和實現(xiàn)類

package com.example.server.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.example.domain.Product;

public interface ProductService extends IService<Product> {
}

package com.example.server.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.domain.Product;
import com.example.server.mapper.ProductMapper;
import com.example.server.service.ProductService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
@Transactional
public class ProductServiceImpl extends ServiceImpl<ProductMapper, Product> implements ProductService {
}

6.8 創(chuàng)建Controller

package com.example.server.controller;

import com.alibaba.fastjson2.JSON;
import com.example.domain.Product;
import com.example.server.service.ProductService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Slf4j
public class ProductController {
    @Autowired
    private ProductService productService;
    //商品信息查詢
    @RequestMapping("/products/{pid}")
    public Product findByPid(@PathVariable("pid") Long pid) {
        log.info("接下來要進行{}號商品信息的查詢", pid);
        Product product = productService.getById(pid);
        log.info("商品信息查詢成功,內容為{}", JSON.toJSONString(product));
        return product;
    }
}

6.9 編寫啟動類ProductServer.java

package com.example.server;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
@MapperScan("com.example.server.mapper")
public class ShopProductServerApplication {

    public static void main(String[] args) {
        SpringApplication.run(ShopProductServerApplication.class, args);
    }

}

6.10 通過瀏覽器訪問服務

最新版 !快速掌握JDK17 + springboot3 + springcloud Alibaba : 1、 微服務環(huán)境搭建,springcloud Alibaba,spring Cloud,微服務,java,spring boot

7 創(chuàng)建訂單微服務

7.1 創(chuàng)建shop-order-api項目,然后在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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>com.example</groupId>
        <artifactId>shop</artifactId>
        <version>1.0.0</version>
    </parent>
    <artifactId>shop-order-api</artifactId>
    <version>1.0.0</version>

    <properties>
        <java.version>17</java.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>com.baomidou</groupId>
            <artifactId>mybatis-plus-boot-starter</artifactId>
            <version>3.5.3.1</version>
        </dependency>
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
        </dependency>
    </dependencies>

</project>

7.2 創(chuàng)建實體類

package com.example.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import java.io.Serializable;

//訂單
@Getter
@Setter
@ToString
@TableName("t_order")
public class Order implements Serializable {
    //訂單id
    @TableId(type = IdType.AUTO)
    private Long id;
    //用戶id
    private Long uid;
    //用戶名
    private String username;
    //商品id
    private Long pid;
    //商品名稱
    private String productName;
    //商品單價
    private Double productPrice;
    //購買數(shù)量
    private Integer number;
}

7.3 創(chuàng)建shop-order-server項目,然后在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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>com.example</groupId>
        <artifactId>shop</artifactId>
        <version>1.0.0</version>
    </parent>
    <artifactId>shop-order-server</artifactId>
    <version>1.0.0</version>

    <properties>
        <java.version>17</java.version>
    </properties>
    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
        </dependency>

        <dependency>
            <groupId>com.alibaba</groupId>
            <artifactId>fastjson</artifactId>
            <version>2.0.32</version>
        </dependency>
        <dependency>
            <groupId>com.example</groupId>
            <artifactId>shop-order-api</artifactId>
            <version>1.0.0</version>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
        </plugins>
    </build>

</project>

7.4 編寫配置文件application.yml

server:
  port: 8091
spring:
  application:
    name: order-service
  datasource:
    driver-class-name: com.mysql.cj.jdbc.Driver
    url: jdbc:mysql://localhost:3306/shop-order?serverTimezone=UTC&useUnicode=true&characterEncoding=utf-8&useSSL=true
    username: root
    password: aaaaaa

7.5 在數(shù)據(jù)庫中創(chuàng)建shop-order的數(shù)據(jù)庫

CREATE TABLE `t_order` (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主鍵',
  `uid` bigint DEFAULT NULL COMMENT '用戶id',
  `username` varchar(255) DEFAULT NULL COMMENT '用戶名稱',
  `pid` bigint DEFAULT NULL COMMENT '商品id',
  `product_name` varchar(255) DEFAULT NULL COMMENT '商品名稱',
  `product_price` double(255,0) DEFAULT NULL COMMENT '商品單價',
  `number` int DEFAULT NULL COMMENT '購買數(shù)量',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

7.6 創(chuàng)建OrderMapper

package com.example.server.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.domain.Order;

public interface OrderMapper extends BaseMapper<Order> {
}

7.7 創(chuàng)建OrderService接口和實現(xiàn)類

package com.example.server.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.example.domain.Order;

public interface OrderService extends IService<Order> {
    Order createOrder(Long pid, Long uid);
}

package com.example.server.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.domain.Order;
import com.example.server.mapper.OrderMapper;
import com.example.server.service.OrderService;
import org.springframework.stereotype.Service;

@Service
public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements OrderService {
    @Override
    public Order createOrder(Long pid, Long uid) {
        return null;
    }
}

7.8 創(chuàng)建Controller

package com.example.server.controller;

import com.example.domain.Order;
import com.example.server.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("orders")
public class OrderController {
    @Autowired
    private OrderService orderService;
    @PostMapping("/save")  
    public Order order(Long pid, Long uid){
        return orderService.createOrder(pid, uid);
    }
}

7.9 編寫啟動類OrderServer.java

package com.example.server;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
@MapperScan("com.example.server.mapper")
public class ShopOrderServerApplication {

    public static void main(String[] args) {
        SpringApplication.run(ShopOrderServerApplication.class, args);
    }

}

8 服務間如何進行遠程調用

現(xiàn)在存在一個問題,order-server服務創(chuàng)建訂單操作需要配置商品信息,此時怎么辦?

@Service
public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements IOrderService {
    @Override
    public Order createOrder(Long pid, Long uid) {
        Order order = new Order();
        //商品??
        Product product = null;
        order.setPid(pid);
        order.setProductName(product.getName());
        order.setProductPrice(product.getPrice());

        //用戶
        order.setUid(1L);
        order.setUsername("dafei");
        order.setNumber(1);
        super.save(order);
        return order;
    }
}

思考,誰能提供商品信息查詢邏輯呢?

答案:product-server,.

問題來了,怎么調用?這里引入一個新問題:服務與服務間如何調用(交互)?
最新版 !快速掌握JDK17 + springboot3 + springcloud Alibaba : 1、 微服務環(huán)境搭建,springcloud Alibaba,spring Cloud,微服務,java,spring boot

問題來了,怎么用java代碼調用發(fā)起http接口調用嗯?

答案是:RestTemplate

RestTempate 是SpringMVC提供專門用于訪問http請求的工具類

8.1 在shop-order-server項目啟動類上添加RestTemplate的bean配置

package com.example.server;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.web.client.RestTemplate;

@SpringBootApplication
@MapperScan("com.example.server.mapper")
public class ShopOrderServerApplication {

    public static void main(String[] args) {
        SpringApplication.run(ShopOrderServerApplication.class, args);
    }

    @Bean
    public RestTemplate restTemplate(){
        return new RestTemplate();
    }

}

8.2 在OrderServiceImpl中注入RestTemplate并實現(xiàn)遠程調用

package com.example.server.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.domain.Order;
import com.example.domain.Product;
import com.example.server.mapper.OrderMapper;
import com.example.server.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.client.RestTemplate;

@Service
public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements OrderService {
    @Autowired
    private RestTemplate restTemplate;

    @Override
    public Order createOrder(Long pid, Long uid) {
        Order order = new Order();
        //商品
        //方案1:通過restTemplate方式
        String url  = "http://localhost:8081/products/" + pid;
        Product product = restTemplate.getForObject(url, Product.class);

        order.setPid(pid);
        order.setProductName(product.getName());
        order.setProductPrice(product.getPrice());

        //用戶
        order.setUid(uid);
        order.setUsername("張三");
        order.setNumber(1);
        System.out.println(order);
        super.save(order);
        return order;
    }
}

最新版 !快速掌握JDK17 + springboot3 + springcloud Alibaba : 1、 微服務環(huán)境搭建,springcloud Alibaba,spring Cloud,微服務,java,spring boot

上面操作確實完成的服務間調用問題,但是代碼很不優(yōu)雅,存在著一定小瑕疵,比如:ip,端口變了呢?

  • 一旦服務提供者(商品服務)地址變化,就需要手工修改代碼

  • 一旦是多個服務(商品服務)提供者,無法實現(xiàn)負載均衡功能

  • 一旦服務變得越來越多,人工維護調用關系困難

那怎么辦呢, 這時候得引入SpringCloud Alibaba第一個組件:

**組件:**注冊中心–Nacos

功能:動態(tài)的實現(xiàn)服務治理文章來源地址http://www.zghlxwxcb.cn/news/detail-753937.html

到了這里,關于最新版 !快速掌握JDK17 + springboot3 + springcloud Alibaba : 1、 微服務環(huán)境搭建的文章就介紹完了。如果您還想了解更多內容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關文章,希望大家以后多多支持TOY模板網(wǎng)!

本文來自互聯(lián)網(wǎng)用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。如若轉載,請注明出處: 如若內容造成侵權/違法違規(guī)/事實不符,請點擊違法舉報進行投訴反饋,一經(jīng)查實,立即刪除!

領支付寶紅包贊助服務器費用

相關文章

  • Docker WIndows最新版(4.17.x)修改鏡像存儲路徑

    Docker WIndows最新版(4.17.x)修改鏡像存儲路徑

    在 Docker Desktop 4.17.0 版本中,可以按照以下步驟來修改 Docker 鏡像存儲路徑 打開 Docker Desktop 應用程序,單擊頂部菜單欄中的 Docker Desktop 菜單,然后選擇 Resources (資源)選項卡。 在 Resources 選項卡中,選擇 Advanced 部分。 在 Disk image location 配置中點擊 Brower 進行瀏覽路徑 在彈

    2023年04月08日
    瀏覽(24)
  • jdk21(最新版) download 配置(linux window mac)jdk/oracle帳號登錄

    jdk21(最新版) download 配置(linux window mac)jdk/oracle帳號登錄

    直達鏈接 jdk21,17 下載jdk有可能存在要求登錄帳號的情況 macos 雙擊觸發(fā)默認的下載器 配置環(huán)境變量:安裝完成后,需要配置環(huán)境變量以便于在終端中使用 JDK。在 macOS 上,可以在 .bash_profile 或 .zshrc(取決于你使用的 shell)中設置 JAVA_HOME 變量,指向你的 JDK 安裝路徑,然后將

    2024年02月07日
    瀏覽(54)
  • 快速安裝最新版Docker

    快速安裝最新版Docker

    安裝docker 列出系統(tǒng)中以安裝的docker包: 卸載以安裝的docker包 如果系統(tǒng)中沒有docker,則直接進行下一步 安裝docker所需依賴:? 添加docker的yum源: yum安裝docker: 驗證docker版本以確認安裝成功: 如圖所示,docker安裝成功 啟動docker 執(zhí)行以下命令啟動docker: 然后將docker設置為開機

    2024年02月12日
    瀏覽(27)
  • Hombrew中AdoptOpenJDK已廢棄更換Eclipse Temurin安裝最新版JDK,并實現(xiàn)不同JDK版本之間切換

    Hombrew中AdoptOpenJDK已廢棄更換Eclipse Temurin安裝最新版JDK,并實現(xiàn)不同JDK版本之間切換

    ?? 19年之后由于某些原因斷更了三年,23年重新?lián)P帆起航,推出更多優(yōu)質博文,希望大家多多支持~ ?? 古之立大事者,不惟有超世之才,亦必有堅忍不拔之志 ?? 個人CSND主頁——Micro麥可樂的博客 ??《Docker實操教程》專欄以最新的Centos版本為基礎進行Docker實操教程,入門

    2024年02月13日
    瀏覽(23)
  • Kafka快速入門(最新版3.6.0)

    Kafka快速入門(最新版3.6.0)

    1.1 什么是MQ Message Queue(MQ),消息隊列中間件。很多?都說:MQ 通過將消息的發(fā)送和接收分離來實現(xiàn)應?程序的異步和解偶,這個給?的直覺是——MQ 是異步的,?來解耦的,但是這個只是 MQ 的效果?不是?的。 MQ 真正的?的是 為了通訊 ,屏蔽底層復雜的通訊協(xié)議,定義

    2024年02月07日
    瀏覽(17)
  • SpringBoot2.7升級項目到Springboot3.1踩坑指南(jdk17/jdk21)

    由于SpringBoot3.x全面擁抱JDK17,兼容jdk21,jdk17乃是大勢所趨。這里是從SpringBoot2.7--SpringBoot3.1踩坑指南。 提前閱讀:jdk8升級JDK17避坑指南(適用于SpringBoot2.3—SpringBoot2.7升級) 國內頂級開源項目升級到springBoot3情況,可以作為升級SpringBoot3的風向標。僅對比國內規(guī)模使用,落地過

    2024年03月09日
    瀏覽(28)
  • 2023最新版IDEA創(chuàng)建一個SpringBoot項目 (詳細教程)

    2023最新版IDEA創(chuàng)建一個SpringBoot項目 (詳細教程)

    springboot是我們java開發(fā)中最流行的框架之一,下面我們看看如何在idea中創(chuàng)建一個springboot項目。 Spring Boot是由Pivotal團隊提供的全新框架,其設計目的是用來簡化新Spring應用的初始搭建以及開發(fā)過程。該框架使用了特定的方式來進行配置,從而使開發(fā)人員不再需要定義樣板化的

    2024年02月04日
    瀏覽(22)
  • Selenium安裝WebDriver:ChromeDriver與谷歌瀏覽器版本快速匹配_最新版120

    Selenium安裝WebDriver:ChromeDriver與谷歌瀏覽器版本快速匹配_最新版120

    最近在使用通過selenium操作Chrome瀏覽器時,安裝中遇到了Chrome版本與瀏覽器驅動不匹配的的問題,在此記錄安裝下過程,如何快速找到與谷歌瀏覽器相匹配的ChromeDriver驅動版本。 1. 確定Chrome版本 我們首先確定自己的Chrome版本 Chrome設置-關于Chrome ?我的是最近安裝的官網(wǎng)上當前

    2024年02月04日
    瀏覽(97)
  • JDK9~17+Springboot3 @Resource常見問題和解決方案

    JDK9~17+Springboot3 @Resource常見問題和解決方案

    因為JDK版本升級的改動,在Jdk9~17環(huán)境下,搭建Springboot項目,會出現(xiàn)原有@Resource(javax.annotation.Resource)不存在的問題,導致項目從Jdk8遷移到高版本時遇到的問題 原因 你可能會問,為什么javax.annotation.Resource注解不存在呢? ?從Jdk9開始,JavaEE從Jdk中分離,jdk就移除掉了javax.a

    2024年02月04日
    瀏覽(99)
  • RuoYi若依管理系統(tǒng)最新版 基于SpringBoot的權限管理系統(tǒng)

    RuoYi是一個后臺管理系統(tǒng),基于經(jīng)典技術組合(Spring Boot、Apache Shiro、MyBatis、Thymeleaf)主要目的讓開發(fā)者注重專注業(yè)務,降低技術難度,從而節(jié)省人力成本,縮短項目周期,提高軟件安全質量。 本地版本為截止2023-9-10最新版本V4.7.7 完全響應式布局(支持電腦、平板、手機等所

    2024年02月09日
    瀏覽(28)

覺得文章有用就打賞一下文章作者

支付寶掃一掃打賞

博客贊助

微信掃一掃打賞

請作者喝杯咖啡吧~博客贊助

支付寶掃一掃領取紅包,優(yōu)惠每天領

二維碼1

領取紅包

二維碼2

領紅包