zzyybs / atguigu_spirngcloud2020 Goto Github PK
View Code? Open in Web Editor NEW第2季当堂代码2020.3
第2季当堂代码2020.3
阳哥不给个脑图吗?
现在问题是这样的:
Eureka的注册中心不能够找到本地启动的其他服务。
代码我是跟着你手敲的。
eureka注册中心,无论是单机版还是集群版,启动都没有问题。
我测试过将eureka注册中心自己注册到eureka服务中
网页上可以显示出当前以注册实例:CLOUD-EUREKA-SERVER
可是当我启动Payment和Order服务之后,eureka网页上却显示不出来这两个实例。
这是7001的application.yml 其他的都是大同小异
server:
port: 7001
spring:
application:
name: eureka-service
eureka:
instance: #Eureka实例名称
hostname: eureka7001.com
client:
registerWithEureka: true #false表示不向注册中心注册自己。
fetchRegistry: false #false表示自己端就是注册中心,我的职责就是维护服务实例,并不需要去检索服务
service-url:
# 设置与Eureka Server交互的地址查询服务和注册服务都需要依赖这个地址
defaultZone: http://eureka7002.com:7002/eureka
server:
enableSelfPreservation: false #开发阶段关闭eureka自我保护机制
这里是当前出错的项目地址
阳哥你好,我想问下Hystrix中的 @EnableCircuitBreaker 注解 和 @EnableHystrix ,都是添加的Hystrix 熔断器,为什么 cloud-provider-hystrix-payment8001 和 cloud-consumer-feign-hystrix-order80 项目中添加的注解不一样.
还请阳哥指点
老师辛苦了。请问有没有脑图呀,老师,方便复习看一看
关于springcloud微服务调用的问题,我在P55做hystrix服务降级的时候,比如说A服务的F1方法调用了B服务的F2方法,F2方法上有服务降级,F1调用F2之后,F2就开始执行,但是F2执行一半的时候发现服务超时了,需要降级,就返回了降级方法里的内容,调用方F1就认为F2方法调用失败了,但实际上F2方法还是在继续执行直到方法结束,这就会造成数据不一致的问题了,如果涉及到数据操作,这里正确的应该是事务回滚了吧,但我现在不知道怎么停了F2这个线程,把事务回滚了,希望大家了解的指导我一下,谢谢
压缩包打不开
老师好,我在gateway模块中遇到这样的问题,现在不知道如何解决,请老师帮忙,
Spring Webflux is missing from the classpath, which is required for Spring Cloud Gateway
at this time. Please add spring-boot-starter-webflux dependency.
老师,您好,关于您的课程 (https://www.bilibili.com/video/BV18E411x7eT?p=147) 第147节里面的内容,我按视频里敲了一遍后,发现一个问题,我以为我敲漏了,然后下载您的源代码运行后,还是有这个问题:
当用了@GlobalTransactional(name = "fsp-create-order",rollbackFor = Exception.class) 后,在调用扣除余额的微服务时,用了【//暂停几秒钟线程 try { TimeUnit.SECONDS.sleep(20); } catch (InterruptedException e) { e.printStackTrace(); } 】后,订单表确实没有新订单创建、库存表确实没有扣减库存;但是账户表,刚开始是没有扣减余额,但过了20秒后,余额扣减了。
也就是从1订单-->到2库存-->到3扣余额,前二步都回滚了,但第3步的微服务,自己等待自己的超时时间完成后,依然执行了自己的流程。
请问如何解决这类问题?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.