美文网首页
十一、Spring Cloud Gateway-Actuator

十一、Spring Cloud Gateway-Actuator

作者: 侯文_ad82 | 来源:发表于2019-08-27 11:23 被阅读0次

    /gateway执行器端允许监视Spring Cloud Gateway应用程序并与之交互。要进行远程访问,必须在应用程序属性中通过HTTP或JMX启用和公开端。

    Retrieving route filters

    Global Filters

    要检索应用于所有路由的全局过滤器,请向/actuator/gateway/globalfilters发出GET请求。 结果响应类似于以下内容:

    响应包含有关全局过滤器的详细信息。 对于每个全局过滤器,提供过滤器对象的字符串表示(例如,org.springframework.cloud.gateway.filter.LoadBalancerClientFilter@77856cc5)以及过滤器链中的相应顺序。

    Route Filters

    要检索应用于路由的GatewayFilter工厂,请向/actuator/gateway/routefilters发出GET请求。 结果响应类似于以下内容:

    响应包含应用于任何特定路由的GatewayFilter工厂的详细信息。 为每个工厂提供相应对象的字符串表示(例如,[SecureHeadersGatewayFilterFactory @ fceab5d configClass = Object])。 请注意,null值是由于端点控制器的实现不完整,因为它尝试设置过滤器链中对象的顺序,这不适用于GatewayFilter工厂对象。

    Refreshing the route cache

    要清除路由缓存,请对/actuator/gateway/refresh发出POST请求。 请求返回200没有响应正文。

    Retrieving the routes defined in the gateway

    要检索网关中定义的路由,请对/actuator/gateway/routes发出GET请求。 结果响应类似于以下内容:

    响应包含网关中定义的所有路由的详细信息。 下表描述了响应的每个元素(即路由)的结构。

    Retrieving information about a particular route

    要检索有关单个路由的信息,请向/actuator/gateway/routes/{id}发出GET请求(例如,/actuator/gateway/routes/first_route)。 结果响应类似于以下内容:

    The following table describes the structure of the response.

    Creating and deleting a particular route

    要创建路由,请使用指定路由字段的JSON body 向/ gateway/routes/ {id_route_to_create}发出POST请求(请参阅上一小节)。

    要删除路由,请向/ gateway/routes/{id_route_to_delete}发出DELETE请求。

    Recap: list of all endpoints

    下表总结了Spring Cloud Gateway执行器端。 请注意,每个端点都有/actuator/gateway作为base-path。

    相关文章

      网友评论

          本文标题:十一、Spring Cloud Gateway-Actuator

          本文链接:https://www.haomeiwen.com/subject/dowrkctx.html