条件评估报告 (conditions)

conditions 端点提供有关配置和自动配置类条件评估的信息。

获取报告

要获取报告,请向 /actuator/conditions 发送 GET 请求,如以下基于 curl 的示例所示:

$ curl 'https://:8080/actuator/conditions' -i -X GET

结果响应类似于以下内容

HTTP/1.1 200 OK
Content-Type: application/vnd.spring-boot.actuator.v3+json
Content-Length: 3082

{
  "contexts" : {
    "application" : {
      "negativeMatches" : {
        "GsonHttpMessageConvertersConfiguration" : {
          "notMatched" : [ {
            "condition" : "OnClassCondition",
            "message" : "@ConditionalOnClass did not find required class 'com.google.gson.Gson'"
          } ],
          "matched" : [ ]
        },
        "Jackson2HttpMessageConvertersConfiguration.MappingJackson2XmlHttpMessageConverterConfiguration" : {
          "notMatched" : [ {
            "condition" : "OnClassCondition",
            "message" : "@ConditionalOnClass did not find required class 'tools.jackson.dataformat.xml.XmlMapper'"
          } ],
          "matched" : [ ]
        },
        "Jackson2HttpMessageConvertersConfiguration.MappingJackson2HttpMessageConverterConfiguration" : {
          "notMatched" : [ {
            "condition" : "Jackson2HttpMessageConvertersConfiguration.PreferJackson2OrJacksonUnavailableCondition",
            "message" : "AnyNestedCondition 0 matched 2 did not; NestedCondition on Jackson2HttpMessageConvertersConfiguration.PreferJackson2OrJacksonUnavailableCondition.JacksonUnavailable @ConditionalOnMissingBean (types: org.springframework.http.converter.json.JacksonJsonHttpMessageConverter; SearchStrategy: all) found beans of type 'org.springframework.http.converter.json.JacksonJsonHttpMessageConverter' jacksonJsonHttpMessageConverter; NestedCondition on Jackson2HttpMessageConvertersConfiguration.PreferJackson2OrJacksonUnavailableCondition.Jackson2Preferred @ConditionalOnProperty (spring.http.converters.preferred-json-mapper=jackson2) did not find property 'spring.http.converters.preferred-json-mapper'"
          } ],
          "matched" : [ {
            "condition" : "OnClassCondition",
            "message" : "@ConditionalOnClass found required class 'com.fasterxml.jackson.databind.ObjectMapper'"
          } ]
        }
      },
      "positiveMatches" : {
        "EndpointAutoConfiguration#propertiesEndpointAccessResolver" : [ {
          "condition" : "OnBeanCondition",
          "message" : "@ConditionalOnMissingBean (types: org.springframework.boot.actuate.endpoint.EndpointAccessResolver; SearchStrategy: all) did not find any beans"
        } ],
        "EndpointAutoConfiguration#endpointOperationParameterMapper" : [ {
          "condition" : "OnBeanCondition",
          "message" : "@ConditionalOnMissingBean (types: org.springframework.boot.actuate.endpoint.invoke.ParameterValueMapper; SearchStrategy: all) did not find any beans"
        } ],
        "EndpointAutoConfiguration#endpointCachingOperationInvokerAdvisor" : [ {
          "condition" : "OnBeanCondition",
          "message" : "@ConditionalOnMissingBean (types: org.springframework.boot.actuate.endpoint.invoker.cache.CachingOperationInvokerAdvisor; SearchStrategy: all) did not find any beans"
        } ]
      },
      "unconditionalClasses" : [ "org.springframework.boot.autoconfigure.context.PropertyPlaceholderAutoConfiguration", "org.springframework.boot.actuate.autoconfigure.endpoint.EndpointAutoConfiguration" ]
    }
  }
}

响应结构

响应包含应用程序条件评估的详细信息。下表描述了响应的结构:

路径 类型 描述

contexts

对象

按 ID 键控的应用程序上下文。

contexts.*.positiveMatches

对象

条件匹配的类和方法。

contexts.*.positiveMatches.*.[].condition

字符串

条件的名称。

contexts.*.positiveMatches.*.[].message

字符串

条件匹配的原因的详细信息。

contexts.*.negativeMatches

对象

条件不匹配的类和方法。

contexts.*.negativeMatches.*.notMatched

数组

未匹配的条件。

contexts.*.negativeMatches.*.notMatched.[].condition

字符串

条件的名称。

contexts.*.negativeMatches.*.notMatched.[].message

字符串

条件不匹配的原因的详细信息。

contexts.*.negativeMatches.*.matched

数组

未匹配的条件。

contexts.*.negativeMatches.*.matched.[].condition

字符串

条件的名称。

contexts.*.negativeMatches.*.matched.[].message

字符串

条件匹配的原因的详细信息。

contexts.*.unconditionalClasses

数组

如果存在,则为无条件自动配置类的名称。

contexts.*.parentId

字符串

父应用程序上下文的 ID(如果有)。

© . This site is unofficial and not affiliated with VMware.