條件評估報告 (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.