Code Monkey home page Code Monkey logo

spring-cloud-demo's Introduction

Spring Cloud 基础案例

案例集成了Eureka、Zuul、OpenFeign、Zipkin、Hystrix等SpringCloud组件和基本使用方法。

Dependencies

  • spring boot parent
<parent>
	<groupId>org.springframework.boot</groupId>
	<artifactId>spring-boot-starter-parent</artifactId>
	<version>2.1.3.RELEASE</version>
	<relativePath/> <!-- lookup parent from repository -->
</parent>
  • spring cloud
<dependencyManagement>
	<dependencies>
		<dependency>
			<groupId>org.springframework.cloud</groupId>
			<artifactId>spring-cloud-dependencies</artifactId>
			<version>Greenwich.RELEASE</version>
			<type>pom</type>
			<scope>import</scope>
			</dependency>
	</dependencies>
</dependencyManagement>

运行项目

mvn package
java -jar eureka-server/target/eureka-server-2.1.0.jar
java -jar api-gateway/target/api-gateway-2.1.0.jar
java -jar open-feign/target/open-feign-2.1.0.jar
java -jar service-A/target/service-A-2.1.0.jar

Eureka Server

http://localhost:1111/

eureka server

Zuul

http://localhost:5555/api-a?a=1&b=2

openfeign

http://localhost:2300/?a=1&b=2

Zipkin链路追踪

curl -sSL https://zipkin.io/quickstart.sh | bash -s
java -jar zipkin.jar

http://localhost:9411

zipkin

Hystrix

http://127.0.0.1:5555/hystrix

配置 http://127.0.0.1:5555/hystrix.stream

Hystrix

功能介绍

  • 1.服务注册和发现
  • 2.api-gateway 认证,负载,熔断。具体参考 项目中的配置文件
  • 3.service 服务,基本的运算

参考地址

spring-cloud-demo's People

Contributors

iceopen avatar

Stargazers

 avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.