Spring Cloud
Marvin Zhong
做自己,坚持梦想,努力...
展开
-
Mapping Set to Strict, Dynamic Introduction of [_Class] Within [_Doc] Is Not Allowed
强制对ES的mapping加了dynamic:strict限制后,突然报了Mapping Set to Strict, Dynamic Introduction of [_Class] Within [_Doc] Is Not Allowed.官方解释:Mapping uses type hints embedded in the document sent to the server to allow generic type mapping. Those type hints are repr原创 2021-05-13 22:58:42 · 4661 阅读 · 0 评论 -
spring stream kafka partition
问题: 给下游通过kafka下发数据,怎么来保证下发的同一个主键的数据到同一个partition答:有两种方式来实现这个需求1. 通过复写PartitionKeyExtractorStrategy和PartitionSelectorStrategy,通过自定义策略来实现partition分配规则,主要代码:public class CustomPartitionKeyExtractor implements PartitionKeyExtractorStrategy { priv原创 2021-01-21 15:54:00 · 447 阅读 · 0 评论 -
Spring cloud stream 配置多个RabbitMQ
配置多MQ的时候出现如下错误:org.springframework.context.ApplicationContextException: Failed to start bean 'outputBindingLifecycle'; nested exception is java.lang.IllegalStateException: A default binder has been requested, but there is more than one binder available f原创 2020-12-12 00:29:56 · 1922 阅读 · 0 评论 -
Spring Cloud Stream for Kafka
1.首先在工程中添加关于Spring stream的包,包括了rabbit和kafka<dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-stream</artifactId></dependency><dependency> <groupId>org.spring原创 2020-11-21 23:39:19 · 602 阅读 · 0 评论 -
spring cloud 实战入门(一)
一步一步体验微服务搭建微服务注册中心Tools: IntelliJIDEA1.New Project2. 添加项目信息3.如图,然后点击Next,添加相关信息后,自动创建了Eureka工程.4.创建好的工程5. 这时候编辑会报错打开EurekaApplication, 在类上面添加@EnableEurekaServerpackage com...原创 2019-07-17 22:29:17 · 87 阅读 · 0 评论 -
spring cloud 实战入门(二)
Eureka注册服务中心建好之后,创建一个服务来测试一下.任务:创建product服务Tools:IntelliJ IDEA1.创建一个工程2.此改项目名称3.选择Eureka Discovery Client4. 添加信息4.工程信息:5. 此时需要配置两个信息(特别重要)application name和eureka server 的ur...原创 2019-07-17 23:11:24 · 69 阅读 · 0 评论 -
spring cloud 实战入门(三)
服务之间的调用在上面两篇文章中,我们分别创建了注册中心eurek和一个服务pricing,这一单介绍服务之间的调.首先按照上一篇再创建一个服务product和上一篇一样在application.properties里面配置端口号port,application name, eureka server 的地址server.port=8082spring.application...原创 2019-08-16 09:27:12 · 95 阅读 · 0 评论