Dry Goods sharing microservices Spring-cloud (6. API Gateway Service Zuul)

Source: Internet
Author: User

Spring Cloud ZuultheNetflix Zuulthe encapsulation is implemented

new Spring boot project demo-springcloud-api-gateway, creating startup class Zuulapplication,@ Enablezuulproxy Start the configuration of the gateway agent, which is also a combination of annotations, enabling service registration discovery and fuses

Project-Critical dependency Spring-cloud-starter-zuul support for gateways

The configuration file application.properties, the routing configuration mainly has the traditional route and the service route, the traditional route is the IP and the port this, the service route is uses the service name as the route. Traditional routes we configured as /tradition/**, service routing configured for /servicetoclient and Servicetoconsumer


Start the registry, start the service provider, launch Demo-springcloud-api-gateway, browser access Http://localhost:4441/tradition/hello and http://localhost:4441 /servicetoclient/hello and Http://localhost:4441/serviceToConsumer/hello and http://localhost:4441/ Demo-springcloud-consumer/hello are normally accessed

Dry Goods sharing microservices Spring-cloud (6. API Gateway Service Zuul)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.