随笔分类 - 分布式
摘要:DefaultMQProducer defaultMQProducer = new DefaultMQProducer("default"); defaultMQProducer.setNamesrvAddr("localhost:9876"); defaultMQProducer.start();
阅读全文
摘要:Nacos注册中心 下载nacos 最新稳定版本 https://github.com/alibaba/nacos/releases 目前最新文档的版本是2.1.0 下载完成后修改默认集群模式 修改为standalone单机模式 启动nacos,访问页面http://localhost:8848/n
阅读全文
摘要:依赖 <!-- kafka --> <dependency> <groupId>org.springframework.kafka</groupId> <artifactId>spring-kafka</artifactId> </dependency> 配置 spring: kafka: boot
阅读全文
摘要:配置负载均衡 events { worker_connections 1024; } http { include mime.types; default_type application/octet-stream; sendfile on; keepalive_timeout 65; server
阅读全文
摘要:消息的两种模式 点对点模式,消费消息后删除消息 发布订阅模式,消息携带主题,消费消息后不删除消息 架构 topic是逻辑上的概念,表示消息主题,每个消息都需要指定主题,一个topic分为多个partition Partition是物理上的概念,每个Partition对应一个log存储,Partiti
阅读全文
摘要:注册中心 版本 使用的版本 | spring.cloud.alibaba | nacos | | | | | 2.1.0.RELEASE | NACOS1.3.2 | 依赖 <!--spring boot 2.2.2--> <dependency> <groupId>org.springframew
阅读全文
摘要:依赖 <!-- redisson 分布式锁--> <dependency> <groupId>org.redisson</groupId> <artifactId>redisson-spring-boot-starter</artifactId> <version>3.11.6</version>
阅读全文
摘要:架构 Trigger Trigger用于定义调度任务的时间规则,在Quartz中主要有四种类型的Trigger:SimpleTrigger、CronTrigger、DataIntervalTrigger和NthIncludedTrigger。 SimpleTrigger:简单的触发器 Calenda
阅读全文
摘要:## Java基础 介绍下序列化和反序列化 ``` 什么? 序列号就是将java对象转化为字节序列的过程,反之 作用? 将对象持久化磁盘、数据库中,或者与浏览器交互时需要序列号和反序列化 为什么要实现接口? JVM在类加载的时候如果发现实现了Serializable接口,然后在对象实例化时会实现序列
阅读全文
摘要:注册中心 Eureka 导入依赖 pom.xml <dependencies> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-netflix-eureka-serv
阅读全文