ZUUL

1643 ワード

Zuul機能:1.検証とセキュリティ:さまざまなリソース向けの検証要件を識別し、要件と一致しないリクエストを拒否します.2.審査とモニタリング:エッジ位置で有意義なデータと統計結果を追跡し、正確な生産状態の結論をもたらす.3.動的ルーティング:要求を必要に応じて異なるバックエンドクラスタに動的にルーティングする.4.圧力テスト:クラスタへの負荷流量を徐々に増加し、性能レベルを計算する.5.負荷割当:各負荷タイプに対応する容量を割り当て、制限値を超えた要求を破棄します.6.静的応答処理:内部クラスタへの流入を回避するために、エッジ位置で直接部分応答を確立する.7.多領域弾性:AWS領域にまたがって要求ルーティングを行い、ELB使用の多様化を実現し、エッジ位置が使用者にできるだけ近いことを保証することを目的とする.
1、pomファイル

   org.springframework.cloud
    spring-cloud-starter-eureka


    org.springframework.cloud
    spring-cloud-starter-zuul


2、application.properties
server.port=9920
spring.application.name=ecloanzuul9920
#DB
spring.devtools.restart.enabled=true

##
eureka.instance.prefer-ip-address=true
eureka.instance.instance-id=ecloanzuul9920.com
eureka.client.serviceUrl.defaultZone=http://eureka7002.com:7002/eureka/,http://eureka7001.com:7001/eureka/
##      eureka.server.enable-self-preservation=false

info.appName = ecloanzuul
info.companyName = www.ecloanzuul.com
info.build.artifactId = $project.artifactId$
info.build.version = $project.version$

zuul.routes.mydept.service-id=DEPT01-8001
zuul.routes.mydept.path=/mydept/**
##         
zuul.routes.ignored-services="*"
##      
zuul.prefix=/xxx


3、起動クラス
@SpringBootApplication(exclude= {DataSourceAutoConfiguration.class})
@EnableZuulProxy
public class EcloanZuul9920
{
    public static void main( String[] args )
    {
        SpringApplication.run(EcloanZuul9920.class,args);
    }
}