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

四,Eureka 第四章

 

 

 2.1.3 增加依赖

 <!--添加依赖--><dependencies><!--Eureka Server--><dependency><groupId>org.springframework.cloud</groupId><artifactId>spring-cloud-starter-netflix-eureka-server</artifactId></dependency><!--增加公共方法--><dependency><groupId>cn.bdqn</groupId><artifactId>springcloud-api-commons</artifactId><version>${project.version}</version></dependency><!--web--><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-web</artifactId></dependency><!--监控--><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-actuator</artifactId></dependency><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-devtools</artifactId><scope>runtime</scope><optional>true</optional></dependency><!--测试--><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-test</artifactId><scope>test</scope></dependency></dependencies>

 2.1.4 yml

server:port: 7001
eureka:instance:hostname: localhost #eureka服务器端的client:#false 表示不向注册中心注册自己register-with-eureka: false#false 表示自己端就是注册中心,我的职责就是维护服务实例,并不需要去检索服务fetch-register: falseserver-url:#设置与Eureka server交互的地址查询服务和注册服务都需要依赖这个地址defaultZone: http://${eureka.instance.hostname}:${server.port}/eureka/

 2.1.5编写主启动类


@EnableEurekaServer
@SpringBootApplication
public class EurakeServer7001Application {public static void main(String[] args) {SpringApplication.run(EurakeSever7001Application.class,args);}
}

2.2.2修改pom添加依赖

 <!--添加Eureka client --><dependency><groupId>org.springframework.cloud</groupId><artifactId>spring-cloud-starter-netflix-eureka-client</artifactId></dependency>

2.2.3修改yml:添加Eureka的配置 

 eureka:client:#表示是否将自己注册进EurekaServer默认为trueregister-with-eureka: true#是否从EurekaServer抓取已有的注册信息,默认为true 单节点无所谓,集群必须设置true 才能配合ribbon  使用负载均衡fetch-registry: trueservice-url:defaultZone: http://localhost:7001/eurekainstance:prefer-ip-address: true #使用ip地址注册

2.2.4修改主启动类:标注Eureka客户端


@SpringBootApplication
@EnableEurekaClientpublic class PaymentApplication {public static void main(String[] args) {SpringApplication.run(PaymentApplication.class,args);}
}

 2.3.2修改pom添加依赖

        <!--eureka client--><dependency><groupId>org.springframework.cloud</groupId><artifactId>spring-cloud-starter-netflix-eureka-client</artifactId></dependency>

 2.3.3 修改yml:添加Eureka的配置

eureka:client:#表示是否将自己注册进EurekaServer默认为trueregister-with-eureka: true#是否从EurekaServer抓取已有的注册信息,默认为true 单节点无所谓,集群必须设置true 才能配合ribbon  使用负载均衡fetch-registry: trueserver-url:defaultZone: http://localhost:7001/eurekainstance:prefer-ip-address: true #使用ip地址注册

2.3.4修改启动类 标注Eureka客户端

@SpringBootApplication
@EnableEurekaClient
public class OrderApplication {public static void main(String[] args) {SpringApplication.run(OrderApplication.class,args);}
}

 

 2.3.4修改主启动类 标注为Eureka客户端

2.3.6补充


//    private static final String PAYMENT_URL="http://localhost:8001";@Autowiredprivate RestTemplate restTemplate;@Autowiredprivate DiscoveryClient discoveryClient;//根据id查询@GetMapping("/consumer/payment/get/{id}")public ResponseResult queryById(@PathVariable("id") Integer id){List<ServiceInstance> serviceInstances = discoveryClient.getInstances("SPRINGCLOUD-PAYMENT-PROVIDER-SERVICE");ServiceInstance instance = serviceInstances.get(0);ResponseResult rs = restTemplate.getForObject("http://"+instance.getHost()+instance.getPort()+"/payment/get/"+id,ResponseResult.class);
//            ResponseResult rs =restTemplate.getForObject(PAYMENT_URL+"/payment/get/"+id,ResponseResult.class);return rs;}//创建订单@GetMapping("/consumer/payment/save")public ResponseResult save(Payment payment){
//        ResponseResult rs =restTemplate.postForObject(PAYMENT_URL+"/payment/save", payment,ResponseResult.class);List<ServiceInstance> serviceInstances =   discoveryClient.getInstances("SPRINGCLOUD-PAYMENT-PROVIDER-SERVICE");ServiceInstance instance =  serviceInstances.get(0);ResponseResult rs = restTemplate.postForObject("http://"+instance.getHost()+instance.getPort()+"/payment/save",payment,ResponseResult.class);return  rs;}
}

 

 3.2.1修改pom添加依赖

<!--依赖--><dependencies><!--eureka server--><dependency><groupId>org.springframework.cloud</groupId><artifactId>spring-cloud-starter-netflix-eureka-server</artifactId></dependency><!--公共方法--><dependency><groupId>cn.bdqn</groupId><artifactId>springcloud-api-commons</artifactId><version>${project.version}</version></dependency><!--web--><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-web</artifactId></dependency><!--热部署工具--><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-devtools</artifactId></dependency><!--测试--><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-test</artifactId><scope>test</scope></dependency></dependencies>

3.2.2编写yml

server:port: 7002eureka:instance:hostname: eureka7002.com #eureka服务器端的client:#false 表示不向注册中心注册自己register-with-eureka: false#false 表示自己端就是注册中心,我的职责就是维护服务实例,并不需要去检索服务fetch-registry: falseservice-url:#设置与Eureka server交互的地址查询服务和注册服务都需要依赖这个地址defaultZone: http://${eureka.instance.hostname}:${server.port}/eureka/

 3.2.5 编写启动类

@SpringBootApplication
@EnableEurekaServer
public class EurekaServer7002Application {public static void main(String[] args) {SpringApplication.run(EurekaServer7002Application.class,args);}
}

 

 

 

 3.3.3修改pom添加依赖

<dependencies><!--eureka server--><dependency><groupId>org.springframework.cloud</groupId><artifactId>spring-cloud-starter-netflix-eureka-server</artifactId></dependency><!--公共类--><dependency><groupId>cn.bdqn</groupId><artifactId>springcloud-api-commons</artifactId><version>${project.version}</version></dependency><!--web--><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-web</artifactId></dependency><!--热部署--><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-devtools</artifactId></dependency><!--测试--><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-test</artifactId><scope>test</scope></dependency></dependencies>

 3.3.4编写yml

server:port: 7003eureka:instance:hostname: eureka7003.com #eureka服务器端的client:#false 表示不向注册中心注册自己register-with-eureka: false#false 表示自己端就是注册中心,我的职责就是维护服务实例,并不需要去检索服务fetch-registry: falseservice-url:#设置与Eureka server交互的地址查询服务和注册服务都需要依赖这个地址defaultZone: http://${eureka.instance.hostname}:${server.port}/eureka/

 3.3.5编写启动类

@SpringBootApplication
@EnableEurekaServer
public class EurekaServer7003Application {public static void main(String[] args) {SpringApplication.run(EurekaServer7003Application.class,args);}
}

 

3.4.2 修改后的配置文件 

springcloud-eureka-sever-7001

server:port: 7001
eureka:instance:hostname: eureka7001.com #eureka服务器端的client:#false 表示不向注册中心注册自己register-with-eureka: false#false 表示自己端就是注册中心,我的职责就是维护服务实例,并不需要去检索服务fetch-register: falseservice-url:#设置与Eureka server交互的地址查询服务和注册服务都需要依赖这个地址# defaultZone: http://${eureka.instance.hostname}:${server.port}/eureka/defaultZone: http://eureka7001.com:7002/eureka/,http://eureka7003.com:7002/eureka/

springcloud-eureka-sever-7001 

server:port: 7002eureka:instance:hostname: eureka7002.com #eureka服务器端的client:#false 表示不向注册中心注册自己register-with-eureka: false#false 表示自己端就是注册中心,我的职责就是维护服务实例,并不需要去检索服务fetch-registry: falseservice-url:#设置与Eureka server交互的地址查询服务和注册服务都需要依赖这个地址# defaultZone: http://${eureka.instance.hostname}:${server.port}/eureka/defaultZone: http://eureka7001.com:7001/eureka/,http://eureka7003.com:7003/eureka/

 springcloud-eureka-sever003

server:port: 7003eureka:instance:hostname: eureka7003.com #eureka服务器端的client:#false 表示不向注册中心注册自己register-with-eureka: false#false 表示自己端就是注册中心,我的职责就是维护服务实例,并不需要去检索服务fetch-registry: falseservice-url:#设置与Eureka server交互的地址查询服务和注册服务都需要依赖这个地址# defaultZone: http://${eureka.instance.hostname}:${server.port}/eureka/defaultZone: http://eureka7002.com:7002/eureka/,http://eureka7001.com:7001/eureka/

 

 

4.1支付微服务发布到 Eureka Sever中

 server:port: 8001spring:application:name: springcloud-payment-provider-servicedatasource:type: com.alibaba.druid.pool.DruidDataSourcedriver-class-name: com.mysql.cj.jdbc.Driverurl: jdbc:mysql://127.0.0.1:3306/springcloud_db?useUnicode=true&characterEncoding=utf-8&useSSL=true&serverTimezone=GMTusername: rootpassword: xiaoduo456newmybatis:mapper-locations: classpath:mapper/*.xmltype-aliases-package: cn.bdqn.domain # 所有Entity别名类所在包eureka:client:#表示是否将自己注册进EurekaServer默认为trueregister-with-eureka: true#是否从EurekaServer抓取已有的注册信息,默认为true 单节点无所谓,集群必须设置true 才能配合ribbon  使用负载均衡fetch-registry: trueservice-url:#defaultZone: http://localhost:7001/eurekadefaultZone: http://eureka7001.com:7001/eureka,http://eureka7002.com:7002/eureka,http://eureka7003.com:7003/eureka,instance:prefer-ip-address: true #使用ip地址注册

 

 

 

 4.2订单微服务发布到Eureka Server中 

 server:port: 8001spring:application:name: springcloud-payment-provider-servicedatasource:type: com.alibaba.druid.pool.DruidDataSourcedriver-class-name: com.mysql.cj.jdbc.Driverurl: jdbc:mysql://127.0.0.1:3306/springcloud_db?useUnicode=true&characterEncoding=utf-8&useSSL=true&serverTimezone=GMTusername: rootpassword: xiaoduo456newmybatis:mapper-locations: classpath:mapper/*.xmltype-aliases-package: cn.bdqn.domain # 所有Entity别名类所在包eureka:client:#表示是否将自己注册进EurekaServer默认为trueregister-with-eureka: true#是否从EurekaServer抓取已有的注册信息,默认为true 单节点无所谓,集群必须设置true 才能配合ribbon  使用负载均衡fetch-registry: trueservice-url:#defaultZone: http://localhost:7001/eurekadefaultZone: http://eureka7001.com:7001/eureka,http://eureka7002.com:7002/eureka,http://eureka7003.com:7003/eureka,instance:prefer-ip-address: true #使用ip地址注册

 

5.2.2修改pom 添加依赖

<!--依懒--><dependencies><!--添加Eureka client --><dependency><groupId>org.springframework.cloud</groupId><artifactId>spring-cloud-starter-netflix-eureka-client</artifactId></dependency><!--公共的部分--><dependency><groupId>cn.bdqn</groupId><artifactId>springcloud-api-commons</artifactId><version>1.0-SNAPSHOT</version></dependency><!--web--><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-web</artifactId></dependency><!--监控--><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-actuator</artifactId></dependency><!--数据库--><dependency><groupId>org.mybatis.spring.boot</groupId><artifactId>mybatis-spring-boot-starter</artifactId><version>2.0.0</version></dependency><!--阿里云数据源--><dependency><groupId>com.alibaba</groupId><artifactId>druid-spring-boot-starter</artifactId></dependency><!--驱动--><dependency><groupId>mysql</groupId><artifactId>mysql-connector-java</artifactId></dependency><!--jdbc--><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-jdbc</artifactId></dependency><!--热部署--><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-devtools</artifactId><scope>runtime</scope><optional>true</optional></dependency><!--lombok--><dependency><groupId>org.projectlombok</groupId><artifactId>lombok</artifactId><optional>true</optional></dependency><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-test</artifactId><scope>test</scope></dependency></dependencies>

5.2.3编辑yml 

server:port: 8002spring:application:name: springcloud-payment-provider-servicedatasource:type: com.alibaba.druid.pool.DruidDataSourcedriver-class-name: com.mysql.cj.jdbc.Driverurl: jdbc:mysql://127.0.0.1:3306/springcloud_db?useUnicode=true&characterEncoding=utf-8&useSSL=true&serverTimezone=GMTusername: rootpassword: xiaoduo456newmybatis:mapper-locations: classpath:mapper/*.xmltype-aliases-package: cn.bdqn.domaineureka:client:#表示是否将自己注册进EurekaServer默认为trueregister-with-eureka: true#是否从EurekaServer抓取已有的注册信息,默认为true 单节点无所谓,集群必须设置true 才能配合ribbon  使用负载均衡fetch-registry: trueservice-url:defaultZone: http://eureka7001.com:7001/eureka,http://eureka7002.com:7002/eureka,http://eureka7003.com:7003/eureka,instance:prefer-ip-address: true #使用ip地址注册

5.24编写启动类

@SpringBootApplication
@EnableEurekaClient
public class Payment8002Application {public static void main(String[] args) {SpringApplication.run(Payment8002Application.class,args);}
}

5.25编写PaymentMapper接口 


@Mapper
public interface PaymentMapper {//保存一个支付流水public void insert(Payment payment);//根据id获取具体的支付信息public Payment selectById(@Param("id") Integer id);
}

5.2.6编写PaymentMapper.xml映射文件

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapperPUBLIC "--//mybatis.org//DTD Mapper 3.0//EN""http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.bdqn.Mapper.PaymentMapper"><resultMap id="PaymentResultMap" type="cn.bdqn.domain.Payment"><id column="id" property="id"></id><id column="flow_number" property="flowNumber"></id></resultMap><insert id="insert" parameterType="cn.bdqn.Mapper.PaymentMapper">insert into t_payment(flow_number) values(#{flowNumber})</insert><select id="selectById" resultMap="PaymentResultMap">select  id,flow_number from t_payment where id=#{id};</select>
</mapper>

 5.

5.2.7编写payment业务接口以及实现类


public interface PaymentServer {//保存一个支付流水public void save(Payment payment);//根据id获取具体的支付信息public Payment queryById(Integer id);}

@Service
public class PaymentServerImpl implements PaymentServer {@Autowiredprivate PaymentMapper paymentMapper;@Overridepublic Payment queryById(Integer id) {return paymentMapper.selectById(id);}@Overridepublic void save(Payment payment) {paymentMapper.insert(payment);}
}

 

5.2.8  编写paymentController控制器


@RestController
public class PaymentConroller {@Autowiredprivate PaymentServerImpl paymentServer;@GetMapping("/payment/id/{id}")public ResponseResult queryById(@PathVariable(name="id") Integer id){Payment payment = paymentServer.queryById(id);if(payment!=null) {return  new ResponseResult(200,"成功",payment);}else{return  new ResponseResult(404,"没有对应的记录,查询id"+id,null);}}@PostMapping("/payment/save")public ResponseResult save(@RequestBody Payment payment){try {paymentServer.save(payment);return new ResponseResult(200,"插入成功",null);}catch (Exception e){e.printStackTrace();return new ResponseResult(200,"插入失败",null);}}
}


 

相关文章:

四,Eureka 第四章

2.1.3 增加依赖 <!--添加依赖--><dependencies><!--Eureka Server--><dependency><groupId>org.springframework.cloud</groupId><artifactId>spring-cloud-starter-netflix-eureka-server</artifactId></dependency>&l…...

k8s常见的资源对象使用

目录 一、kubernetes内置资源对象 1.1、kubernetes内置资源对象介绍 1.2、kubernetes资源对象操作命令 二、job与cronjob计划任务 2.1、job计划任务 2.2、cronjob计划任务 三、RC/RS副本控制器 3.1、RC副本控制器 3.2、RS副本控制器 3.3、RS更新pod 四、Deployment副…...

JavaScript 简单实现观察者模式和发布订阅模式

JavaScript 简单实现观察者模式和发布订阅模式 1. 观察者模式1.1 如何理解1.2 代码实现 2. 发布订阅模式2.1 如何理解2.2 代码实现 1. 观察者模式 1.1 如何理解 概念&#xff1a;观察者模式定义对象间的一种一对多的依赖关系&#xff0c;当一个对象的状态发生改变时&#xff…...

高通WLAN框架学习(37)-- TDLS(Tunneled Direct Link Setup)通道直接链路建立

一 TDLS概述 隧道直连设置(TDLS)基于IEEE 802.11z-2010IEEE标准802.11z标准(无线局域网介质访问控制(MAC)和物理层(PHY)规范。 TDLS允许与同一AP关联的设备之间建立直接链路。Wi-Fi Direct允许设备之间直接连接,而不需要AP。Wi-Fi联盟认证可用于IEEE 802.11a和802.11g设备的T…...

高算力AI模组前沿应用:基于ARM架构的SoC阵列式服务器

本期我们带来高算力AI模组前沿应用&#xff0c;基于ARM架构的SoC阵列式服务器相关内容。澎湃算力、创新架构、异构计算&#xff0c;有望成为未来信息化社会的智能算力底座。 ▌性能优势AI驱动&#xff0c;ARM架构服务器加速渗透 一直以来&#xff0c;基于ARM架构的各类处理器…...

老年公寓人员定位管理系统:提升安全与关怀的智能解决方案

老年公寓作为提供安全居住环境和关怀服务的重要场所&#xff0c;面临着人员管理和安全控制的挑战。为了解决这些问题&#xff0c;老年公寓人员定位管理系统应运而生。基于为提供全面的安全管理和个性化关怀服务&#xff0c;华安联大便通过老年公寓人员定位管理系统的技术原理、…...

每日一题之两个字符串的删除操作

题目链接 给定两个单词 word1 和 word2 &#xff0c;返回使得 word1 和 word2 **相同所需的最小步数。 每步 可以删除任意一个字符串中的一个字符。 示例 1&#xff1a; 输入: word1 "sea", word2 "eat" 输出: 2 解释: 第一步将 "sea" 变…...

nacos安装与基础配置

源码 https://github.com/alibaba/nacos https://gitee.com/mirrors/Nacos 编译 git clone https://github.com/alibaba/nacos.git cd nacos/ mvn -Prelease-nacos -Dmaven.test.skiptrue clean install -U ls -al distribution/target/// change the $version to your ac…...

GitHub Copilot:让开发编程变得像说话一样简单

引用&#xff1a; 人类天生就梦想、创造、创新。但今天&#xff0c;我们花太多时间被繁重的工作所消耗&#xff0c;花在消耗我们时间、创造力和精力的任务上。为了重新连接我们工作的灵魂&#xff0c;我们不仅需要一种更好的方式来做同样的事情&#xff0c;更需要一种全新的工…...

并发编程中锁的优化

在 Java 并发编程中&#xff0c;锁是一种常用的同步机制&#xff0c;用于控制对共享资源的访问。使用锁可以确保多个线程之间的互斥访问&#xff0c;避免数据竞争和并发问题。 然而&#xff0c;锁的使用可能会带来一定的性能开销&#xff0c;特别是在高并发场景下。 为了优化…...

笔试题:统计字符串中某字符串在其出现的字符个数

笔试题&#xff1a;统计字符串中某一子串的字符个数&#xff1a;例如字符串aabbcd,有aabb:4,ab:2 哈哈&#xff0c;这道题是小编面试音视频龙头企业的笔试题&#xff0c;以下是我写的代码&#xff1a;如果有错误&#xff0c;希望可以指正!!! 解题思路&#xff1a;利用双指针i和…...

Java NIO Files类读取文件流方式详解

Java NIO Files类读取文件流方式详解 Files类原理概述 java.nio.file.Files是Java标准库提供的一个工具类&#xff0c;用于操作文件和目录。它提供了一系列静态方法&#xff0c;可以用于创建、复制、删除、移动、重命名、读取、写入文件和目录等常见的文件系统操作。同时&…...

Mybatis快速入门,Mybatis的核心配置文件

Mybatis快速入门 一、Mybatis简介1.1Mybatis简化JDBC 二、Mybatis快速入门2.1创建user表&#xff0c;添加数据2.2创建模块&#xff0c;导入坐标2.3编写Mybatis核心配置文件 --> 替换连接信息&#xff0c;解决硬编码问题2.4编写SQL映射文件 --> 统一管理sql语句&#xff0…...

go语言中defer执行顺序

defer 执行顺序和调用顺序相反&#xff0c;类似于栈后进先出。 defer在 return 之后执行&#xff0c;但在函数推出之前&#xff0c;defer可以修改返回值。 func test() int {i : 0defer func() {fmt.Println("defer1")}()defer func() {i 1fmt.Println("defe…...

webpack xxx is not a constructor

环境 webpack5.88.2 vue-router 按需引入 原因 模块循环引用导致 有A B C三个模块 A B模块import C 中导出的class c又依赖B 中Class 的方法 B 又依赖C中的class 此时会导致import 的 C 为undefined...

安装支持vs2019的MFC(解决MSBuild 错误 MSB8041、MSB8042)

安装支持MFC的vs2019&#xff08;解决MSBuild 错误 MSB8041、MSB8042&#xff09; 常用安装选项解决MSBuild 错误 常用安装选项 解决MSBuild 错误 安装上述勾选内容后&#xff0c;即可解决MSBuild 错误 MSB8041 MSB8041&#xff1a;此项目需要 MFC/ATL 库。 https://learn.mic…...

校园电气安全风险分析及预防措施 安科瑞 许敏

摘要:校园属于人员密集场所&#xff0c;若安全风险排查、管控不到位&#xff0c;可能导致安全事故发生&#xff0c;造成严重事故后果。校园电气设备设施引起的电气火灾和触电等事故&#xff0c;是构成校园安全威胁之一&#xff0c;笔者通过对校园发生的电气安全事故案例原因分析…...

机器学习之十大经典算法

机器学习算法是计算机科学和人工智能领域的关键组成部分&#xff0c;它们用于从数据中学习模式并作出预测或做出决策。本文将为大家介绍十大经典机器学习算法&#xff0c;其中包括了线性回归、逻辑回归、支持向量机、朴素贝叶斯、决策树等算法&#xff0c;每种算法都在特定的领…...

系统架构设计师 11:未来信息综合技术

本章花了很多笔墨来写各项技术的发展历程&#xff0c;可以了解一下。 一、信息物理系统 信息物理系统&#xff08;Cyber-Physical Systems&#xff0c;CPS&#xff09;是控制系统、嵌入式系统的扩展与延伸。 CPS典型的应用场景有&#xff1a;健康管理、智能维护、远程征兆性…...

Docker 数据管理[文件互访] 端口映射[暴露端口提供服务] 容器互联[指定容器名防止IP变动]

Docker 的数据管理 管理 Docker 容器中数据主要有两种方式&#xff1a;数据卷&#xff08;Data Volumes&#xff09;和数据卷容器&#xff08;DataVolumes Containers&#xff09;。 1&#xff0e;数据卷&#xff08;宿主机与容器间传输 防止删除容器后数据丢失&#xff09; 数…...

Python|GIF 解析与构建(5):手搓截屏和帧率控制

目录 Python&#xff5c;GIF 解析与构建&#xff08;5&#xff09;&#xff1a;手搓截屏和帧率控制 一、引言 二、技术实现&#xff1a;手搓截屏模块 2.1 核心原理 2.2 代码解析&#xff1a;ScreenshotData类 2.2.1 截图函数&#xff1a;capture_screen 三、技术实现&…...

Docker 运行 Kafka 带 SASL 认证教程

Docker 运行 Kafka 带 SASL 认证教程 Docker 运行 Kafka 带 SASL 认证教程一、说明二、环境准备三、编写 Docker Compose 和 jaas文件docker-compose.yml代码说明&#xff1a;server_jaas.conf 四、启动服务五、验证服务六、连接kafka服务七、总结 Docker 运行 Kafka 带 SASL 认…...

ffmpeg(四):滤镜命令

FFmpeg 的滤镜命令是用于音视频处理中的强大工具&#xff0c;可以完成剪裁、缩放、加水印、调色、合成、旋转、模糊、叠加字幕等复杂的操作。其核心语法格式一般如下&#xff1a; ffmpeg -i input.mp4 -vf "滤镜参数" output.mp4或者带音频滤镜&#xff1a; ffmpeg…...

什么是EULA和DPA

文章目录 EULA&#xff08;End User License Agreement&#xff09;DPA&#xff08;Data Protection Agreement&#xff09;一、定义与背景二、核心内容三、法律效力与责任四、实际应用与意义 EULA&#xff08;End User License Agreement&#xff09; 定义&#xff1a; EULA即…...

算法岗面试经验分享-大模型篇

文章目录 A 基础语言模型A.1 TransformerA.2 Bert B 大语言模型结构B.1 GPTB.2 LLamaB.3 ChatGLMB.4 Qwen C 大语言模型微调C.1 Fine-tuningC.2 Adapter-tuningC.3 Prefix-tuningC.4 P-tuningC.5 LoRA A 基础语言模型 A.1 Transformer &#xff08;1&#xff09;资源 论文&a…...

技术栈RabbitMq的介绍和使用

目录 1. 什么是消息队列&#xff1f;2. 消息队列的优点3. RabbitMQ 消息队列概述4. RabbitMQ 安装5. Exchange 四种类型5.1 direct 精准匹配5.2 fanout 广播5.3 topic 正则匹配 6. RabbitMQ 队列模式6.1 简单队列模式6.2 工作队列模式6.3 发布/订阅模式6.4 路由模式6.5 主题模式…...

SiFli 52把Imagie图片,Font字体资源放在指定位置,编译成指定img.bin和font.bin的问题

分区配置 (ptab.json) img 属性介绍&#xff1a; img 属性指定分区存放的 image 名称&#xff0c;指定的 image 名称必须是当前工程生成的 binary 。 如果 binary 有多个文件&#xff0c;则以 proj_name:binary_name 格式指定文件名&#xff0c; proj_name 为工程 名&…...

Qt 事件处理中 return 的深入解析

Qt 事件处理中 return 的深入解析 在 Qt 事件处理中&#xff0c;return 语句的使用是另一个关键概念&#xff0c;它与 event->accept()/event->ignore() 密切相关但作用不同。让我们详细分析一下它们之间的关系和工作原理。 核心区别&#xff1a;不同层级的事件处理 方…...

JDK 17 序列化是怎么回事

如何序列化&#xff1f;其实很简单&#xff0c;就是根据每个类型&#xff0c;用工厂类调用。逐个完成。 没什么漂亮的代码&#xff0c;只有有效、稳定的代码。 代码中调用toJson toJson 代码 mapper.writeValueAsString ObjectMapper DefaultSerializerProvider 一堆实…...

2025.6.9总结(利与弊)

凡事都有两面性。在大厂上班也不例外。今天找开发定位问题&#xff0c;从一个接口人不断溯源到另一个 接口人。有时候&#xff0c;不知道是谁的责任填。将工作内容分的很细&#xff0c;每个人负责其中的一小块。我清楚的意识到&#xff0c;自己就是个可以随时替换的螺丝钉&…...