dyc87112 / springcloud-learning Goto Github PK
View Code? Open in Web Editor NEWSpring Cloud基础教程,持续连载更新中
Home Page: http://blog.didispace.com
Spring Cloud基础教程,持续连载更新中
Home Page: http://blog.didispace.com
hi 大神,我有多个服务使用熔断,我想聚合数据到一个数据聚合服务,怎么操作呢?是只要把其他服务注册到数据聚合服务嘛??
DcController 中报这个错误?
Could not autowire. No beans of 'DiscoveryClient' type found.
比如公共的缓存/数据库配置是可能很多模块都要用的。希望加载公共配置和自身配置。不希望放在同一个文件中。
楼主,你好!看了你的博客所以买了你的书,书上的版本比较旧了,最新版Finchley版本上集成Logsatsh跑不起,其他的微服务也有微小的变化,可否更新一下教程呢?谢谢!另外,新项目用最新版本还是老版本呢?
修改nacos\conf\application.properties中的配置为nacos.core.auth.enabled=true开启登录权限后,之前测试没有问题的项目启动时报获取不到配置异常,报403,unkwon user;请问这个怎么处理呢?
No qualifying bean of type [] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency.
启动时出现,是因为接口没有实现类,这个问题怎么解决?还是说feign不是这么用的?谢谢!
我有个疑问:声明了一个接口类调用不同provider的controller接口,consumer端如何动态构建FeignClient并制定provider的application.name 来调用? 不要使用指定url的方式,因为需要用到ribbon。 试了好几种方式,都不能,有人有合适的方式吗?
基于这个版本的springboot
org.springframework.boot
spring-boot-starter-parent
1.5.9.RELEASE
Spring Boot: 2.2.0.RELEASE
Spring Cloud : Hoxton.RC1
actuator : 2.2.0.RELEASE
hystrix : spring-cloud-starter-netflix-hystrix
server.port=${PORT}
management.server.port=${MPORT}
management.endpoints.web.exposure.include=*
两个端口取不同值
org.springframework.boot.actuate.autoconfigure.endpoint.web.servlet.WebMvcEndpointManagementContextConfiguration#webEndpointServletHandlerMapping
不同值时 shouldRegisterLinksMapping
变量才会 true
,对扫描到的 HystrixStreamEndpoint
进行注册
http://blog.didispace.com/spring-cloud-starter-dalston-3/#
我按着文中配置
访问info出错
然后想了想,没有info这个mapping,结果对比github果然要加一个actuator
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
例如有三个微服务:eureka、config、user
user的controller中代码如下:
@RequestMapping("${restful.base}")
public class UserController {...}
${restful.base}是在config中的配置
现在user微服务中运行junit,${restful.base}怎么注入进去呢
消费端初始化出错
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'demoAppApplication.TestController': Injection of @org.apache.dubbo.config.annotation.Reference dependencies is failed; nested exception is java.lang.IllegalStateException: Failed to check the status of the service com.gsh56.demo.service.api.HelloService. No provider available for the service com.gsh56.demo.service.api.HelloService from the url spring-cloud://localhost:9090/org.apache.dubbo.registry.RegistryService?application=demo-app&default.lazy=false&default.sticky=false&dubbo=2.0.2&interface=com.gsh56.demo.service.api.HelloService&lazy=false&methods=hello&pid=12640®ister.ip=192.168.90.35&release=2.7.1&side=consumer&sticky=false×tamp=1569343527514 to the consumer 192.168.90.35 use dubbo version 2.7.1
楼主,IDEA中,多个微服务能否在同一个窗口运行呢?因为,为每一个微服务开一个窗口,比较繁琐,随着服务越来越多,调试非常不方便
报错:
Caused by: org.springframework.context.ApplicationContextException: Unable to start EmbeddedWebApplicationContext due to missing EmbeddedServletContainerFactory bean.
记得github上有个项目是寻找东华人的
client中的TestController Spring.value中的from报错
请问如何用namespace,来管理和区分服务???
比如这里的opencloud的管理方式是怎么实现的呢
地址:传送门
opencloud类的服务全都注册到namespace为opencloud的标签页下,是如何做到的,
我测试过程中发现,所有注册的服务都在Public下,
我的配置 :
cloud:
nacos:
discovery:
server-addr: 127.0.0.1:8848
namespace: 0b4d3de4-b8d9-452d-b1fc-d506be6bfe02
config:
server-addr: 127.0.0.1:8848
file-extension: yml
namespace: 0b4d3de4-b8d9-452d-b1fc-d506be6bfe02
group: MYTEST_GROUP
在maven库中发现有两套依赖:
com.alibaba.cloud
org.springframework.cloud
对应的版本号也是0.x跟2.x,这两个有什么区别,如何确定改用哪一个
监控AUTH-SERVICE,URL多了一层mgmt,是什么原因呢?
http://IP:5000/mgmt/uaa/mgmt/health
已打赏10元
Spring Cloud Alibaba基础教程:与Dubbo的完美融合;
我在本地测试遇到了一些qos.server端口占用等问题,都已自行解决,但是依然有个问题就是:
如果服务提供者不启动的话,服务消费者是启动不了的;
即使通过一些网上做法的增加配置能启动了,但是消费服务的时候就会报找不到服务提供者的异常。
关注道兄很久了,有个问题想请教一下。在maven配置spring-cloud-alibaba父工厂的时候,看有的教程里面配置的是
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-alibaba-dependencies</artifactId>
<version>0.2.2.RELEASE</version>
<type>pom</type>
<scope>import</scope>
</dependency>
有的教程又是配置的
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-alibaba-dependencies</artifactId>
<version>2.2.3.RELEASE</version>
<type>pom</type>
<scope>import</scope>
</dependency>
想请问一下org.springframework.cloud下面的和com.alibaba.cloud下面的到底有什么区别?他们之间又有什么渊源吗?项目开发的时候到底应该引入哪个呢?
看了下前者很久没有更新了,而后者一直在更新,如果说前者是阿里捐给spring维护之后的版本,那么为什么阿里自己还要继续维护一份后者呢?他们这两个组件的使用方式上又有什么不同吗?
1.pom.xml如下
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.7.RELEASE</version>
<relativePath/>
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
<spring-cloud.version>Dalston.SR3</spring-cloud.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-eureka-server</artifactId>
</dependency>
</dependencies>
<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>
</dependencies>
</dependencyManagement>
2.application.properties
spring.application.name=eureka-server
server.port=1001
eureka.instance.hostname=localhost
eureka.client.register-with-eureka=false
eureka.client.fetch-registry=false
当我用docker创建好了consul容器 以dev方式启动后,在http://localhost:8500/ui/dc1/services 页面中是可以看到consul-client服务的.调用client的dc方法也可正常获取到服务列表.但是使用loadBalancerClient.choose("consul-client")时,获取到的服务为null.导致下面的服务调用直接报空指针异常.请问大神这个是为什么.
docker的consul启动命令如下:
$ docker run -d --name=dev-consul -p 8500:8500 consul
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.