springcloud 服务网关 gateway zuul

阅读更多

 

 ------------------------------------------------------------------------------------------------------------ 

springcloud (零) springboot 基础      下载

springcloud (一)服务注册中心 eureka   下载

springcloud (二)服务提供方 compute-service  下载

springcloud (三)消费者 Feign(类似 websevice)  下载

springcloud (四)客户端负载均衡 ribbon  下载

springcloud (五)断路由hystrix 下载

springcloud (六)分布式配置中心 config server & config client  下载client 下载server

springcloud (七) bus 分布式队列 rabbitmq 下载

springcloud (八) 服务网关 gateway zuul 下载

 ------------------------------------------------------------------------------------------------------------ 

 

访问 http://localhost:3000/web/users/2 

实际转向 http://localhost:1003/web/users/2

 

 

服务网关作用二 : 收集日志 elkf


springcloud 服务网关 gateway zuul_第1张图片
 


springcloud 服务网关 gateway zuul_第2张图片
 

 

 

 

@SpringBootApplication
@EnableCircuitBreaker
@EnableDiscoveryClient
@EnableZuulProxy
public class SpringBootSampleApplication {

    
     
    
    public static void main(String[] args) {
        SpringApplication.run(SpringBootSampleApplication.class, args);
    }


}

 

 
 
 
spring.mvc.view.prefix=/WEB-INF/jsp/
spring.mvc.view.suffix=.jsp

#one datasource
spring.datasource.url=jdbc:mysql://localhost:3306/database
spring.datasource.username=root
spring.datasource.password=root
spring.datasource.driverClassName=com.mysql.jdbc.Driver 
 
 
eureka.client.serviceUrl.defaultZone=http://localhost:1000/eureka/

spring.application.name=api-gateway
server.port=3000

endpoints.restart.enabled=true
endpoints.shutdown.enabled=true
endpoints.health.sensitive=false


zuul.ignored-services="*"
zuul.routes.web.path=/web/**
zuul.routes.web.url=http://localhost:1003/web/


 

 

 


  4.0.0
  com.curiousby.cn
  SpringCloudDemo-Zuul-Gateway
  war
  0.0.1-SNAPSHOT
  SpringCloudDemo-Feign Maven Webapp
  http://maven.apache.org
  



    
        
            spring-snapshots
            http://repo.spring.io/libs-snapshot
        
    

    
        
            spring-snapshots
            http://repo.spring.io/libs-snapshot
        
    
    

	
        org.springframework.boot
        spring-boot-starter-parent
        1.3.5.RELEASE
         
    

    
        UTF-8
        1.7
    

    
        
    
            org.springframework.cloud
            spring-cloud-starter-zuul
        
        
            org.springframework.cloud
            spring-cloud-starter-eureka
        
        
            org.springframework.cloud
            spring-cloud-starter
        
        
            org.springframework.cloud
            spring-cloud-starter-config
        
        
            org.springframework.boot
            spring-boot-starter-web
        
        
            org.springframework.boot
            spring-boot-starter-actuator
        
   
		
			org.springframework.boot
			spring-boot-starter-test
			test
		
	 
        
    
    
	
	        
	            
	                org.springframework.cloud
	                spring-cloud-dependencies
	                Brixton.RELEASE
	                pom
	                import
	            
	        
	    
	    
	
		SpringCloudDemo-Zuul-Gateway
		
			
				org.springframework.boot
				spring-boot-maven-plugin
			
			
			
				org.apache.maven.plugins
				maven-compiler-plugin
				
					1.7
					1.7
				
			
			
				org.apache.maven.plugins
				maven-surefire-plugin
				
					false
				
			
			
		

	
	

 

 

 

 

 

 

  

 

 

 

 

 

 

 

 

 

 

捐助开发者

在兴趣的驱动下,写一个免费的东西,有欣喜,也还有汗水,希望你喜欢我的作品,同时也能支持一下。 当然,有钱捧个钱场(右上角的爱心标志,支持支付宝和PayPal捐助),没钱捧个人场,谢谢各位。


springcloud 服务网关 gateway zuul_第3张图片springcloud 服务网关 gateway zuul_第4张图片springcloud 服务网关 gateway zuul_第5张图片
 
 
 谢谢您的赞助,我会做的更好!

 

 

  • springcloud 服务网关 gateway zuul_第6张图片
  • 大小: 108 KB
  • springcloud 服务网关 gateway zuul_第7张图片
  • 大小: 108.9 KB
  • 查看图片附件

你可能感兴趣的:(spring,cloud,服务网关,gateway,zuul)