| 此版本仍在开发中,尚不被认为是稳定的。对于最新的稳定版本,请使用 Spring Boot 3.5.5! | 
配置属性 (configprops)
这configpropsendpoint 提供有关应用程序的@ConfigurationProperties豆。
检索所有@ConfigurationProperties Bean
要检索所有@ConfigurationPropertiesbeans,制作一个GET请求/actuator/configprops,如以下基于 curl 的示例所示:
$ curl 'http://localhost:8080/actuator/configprops' -i -X GET生成的响应类似于以下内容:
HTTP/1.1 200 OK
Content-Type: application/vnd.spring-boot.actuator.v3+json
Content-Length: 3411
{
  "contexts" : {
    "application" : {
      "beans" : {
        "management.endpoints.web.cors-org.springframework.boot.actuate.autoconfigure.endpoint.web.CorsEndpointProperties" : {
          "inputs" : {
            "allowedHeaders" : [ ],
            "allowedMethods" : [ ],
            "allowedOrigins" : [ ],
            "maxAge" : { },
            "exposedHeaders" : [ ],
            "allowedOriginPatterns" : [ ]
          },
          "prefix" : "management.endpoints.web.cors",
          "properties" : {
            "allowedHeaders" : [ ],
            "allowedMethods" : [ ],
            "allowedOrigins" : [ ],
            "maxAge" : "PT30M",
            "exposedHeaders" : [ ],
            "allowedOriginPatterns" : [ ]
          }
        },
        "management.endpoints.web-org.springframework.boot.actuate.autoconfigure.endpoint.web.WebEndpointProperties" : {
          "inputs" : {
            "pathMapping" : { },
            "exposure" : {
              "include" : [ {
                "value" : "*",
                "origin" : "\"management.endpoints.web.exposure.include\" from property source \"Inlined Test Properties\""
              } ],
              "exclude" : [ ]
            },
            "basePath" : { },
            "discovery" : {
              "enabled" : { }
            }
          },
          "prefix" : "management.endpoints.web",
          "properties" : {
            "pathMapping" : { },
            "exposure" : {
              "include" : [ "*" ],
              "exclude" : [ ]
            },
            "basePath" : "/actuator",
            "discovery" : {
              "enabled" : true
            }
          }
        },
        "spring.web-org.springframework.boot.autoconfigure.web.WebProperties" : {
          "inputs" : {
            "localeResolver" : { },
            "resources" : {
              "staticLocations" : [ { }, { }, { }, { } ],
              "addMappings" : { },
              "chain" : {
                "cache" : { },
                "compressed" : { },
                "strategy" : {
                  "fixed" : {
                    "enabled" : { },
                    "paths" : [ { } ]
                  },
                  "content" : {
                    "enabled" : { },
                    "paths" : [ { } ]
                  }
                }
              },
              "cache" : {
                "cachecontrol" : { },
                "useLastModified" : { }
              }
            }
          },
          "prefix" : "spring.web",
          "properties" : {
            "localeResolver" : "ACCEPT_HEADER",
            "resources" : {
              "staticLocations" : [ "classpath:/META-INF/resources/", "classpath:/resources/", "classpath:/static/", "classpath:/public/" ],
              "addMappings" : true,
              "chain" : {
                "cache" : true,
                "compressed" : false,
                "strategy" : {
                  "fixed" : {
                    "enabled" : false,
                    "paths" : [ "/**" ]
                  },
                  "content" : {
                    "enabled" : false,
                    "paths" : [ "/**" ]
                  }
                }
              },
              "cache" : {
                "cachecontrol" : { },
                "useLastModified" : true
              }
            }
          }
        }
      }
    }
  }
}响应结构
响应包含应用程序的@ConfigurationProperties豆。
下表描述了响应的结构:
| 路径 | 类型 | 描述 | 
|---|---|---|
| 
 | 
 | 以 id 键入的应用程序上下文。 | 
| 
 | 
 | 
 | 
| 
 | 
 | 应用于 bean 属性名称的前缀。 | 
| 
 | 
 | bean 的属性作为名称-值对。 | 
| 
 | 
 | 绑定到此 bean 时使用的配置属性的来源和值。 | 
| 
 | 
 | 父应用程序上下文的 ID(如果有)。 | 
按前缀检索@ConfigurationProperties Bean
要检索@ConfigurationPropertiesbean 映射在某个前缀下,将GET请求/actuator/configprops/{prefix},如以下基于 curl 的示例所示:
$ curl 'http://localhost:8080/actuator/configprops/spring.jackson' -i -X GET生成的响应类似于以下内容:
HTTP/1.1 200 OK
Content-Disposition: inline;filename=f.txt
Content-Type: application/vnd.spring-boot.actuator.v3+json
Content-Length: 878
{
  "contexts" : {
    "application" : {
      "beans" : {
        "spring.jackson-org.springframework.boot.jackson.autoconfigure.JacksonProperties" : {
          "inputs" : {
            "serialization" : { },
            "visibility" : { },
            "parser" : { },
            "datatype" : {
              "jsonNode" : { },
              "enum" : { }
            },
            "deserialization" : { },
            "generator" : { },
            "mapper" : { }
          },
          "prefix" : "spring.jackson",
          "properties" : {
            "serialization" : { },
            "visibility" : { },
            "parser" : { },
            "datatype" : {
              "jsonNode" : { },
              "enum" : { }
            },
            "deserialization" : { },
            "generator" : { },
            "mapper" : { }
          }
        }
      }
    }
  }
}| 这 {prefix}不需要精确,更通用的前缀将返回映射在该前缀词干下的所有 bean。 | 
响应结构
响应包含应用程序的@ConfigurationProperties豆。
下表描述了响应的结构:
| 路径 | 类型 | 描述 | 
|---|---|---|
| 
 | 
 | 以 id 键入的应用程序上下文。 | 
| 
 | 
 | 
 | 
| 
 | 
 | 应用于 bean 属性名称的前缀。 | 
| 
 | 
 | bean 的属性作为名称-值对。 | 
| 
 | 
 | 绑定到此 bean 时使用的配置属性的来源和值。 | 
| 
 | 
 | 父应用程序上下文的 ID(如果有)。 |