Commit Graph

1792 Commits

Author SHA1 Message Date
Johnny Lim 14c9f91aab Polish
Closes gh-10054
2017-08-22 16:28:03 +02:00
Stephane Nicoll ac4219b1d8 Move management.jmx to management.endpoints.jmx
For consistency with #10053, this commit moves the JMX specific endpoint
properties to `management.endpoints.jmx`.
2017-08-22 11:46:38 +02:00
Stephane Nicoll 68fcea7b9a Migrate endpoints.cors to management.endpoints.cors
This commit moves CORS properties out of the endpoints namespace as they
do not refer to a "cors" endpoint but rather to the CORS configuration
of all endpoints.

Closes gh-10053
2017-08-22 11:40:39 +02:00
Stephane Nicoll 3087514b79 Move endpoints.health.mapping to management.health.status.http-mapping
Closes gh-10052
2017-08-22 11:11:22 +02:00
Stephane Nicoll 79bdaad686 Remove reference to HttpStatus
This commit removes an import on a class in "spring-web" as this class
is also meant to be used with Jersey only (i.e. when "spring-web" is
not present on the classpath).

Closes gh-10051
2017-08-22 10:03:32 +02:00
Stephane Nicoll 394371eb73 Polish "Harmonize database initializers"
Closes gh-9752
2017-08-18 18:14:22 +02:00
Johnny Lim a7ef258069 Polish
Closes gh-10032
2017-08-18 11:28:33 +02:00
Stephane Nicoll ad3a14141f Polish endpoints metadata
This commit introduces manual metadata for the endpoints.all.* namespace
and polish the appendix following the work that happened in #9692
2017-08-17 11:34:08 +02:00
Stephane Nicoll 80793b3148 Cleanup additional meta-data
The new endpoint infrastructure does not provide a `path` property so
the manual metadata for older endpoints have been removed.
2017-08-17 11:07:02 +02:00
Stephane Nicoll 19e211a1c2 Add Status endpoint
This commit adds a new `/application/status` endpoint that provides only
the Health's status of an application.

Previously, `/application/health` was returning full health details or
only the status depending on configuration. Those two use cases are now
separate in two endpoints that can be configured, secured and enabled
separately.

Closes gh-9721
2017-08-16 15:30:41 +02:00
Stephane Nicoll b9bbe9ee01 Polish 2017-08-16 13:52:40 +02:00
Stephane Nicoll 74b552826b Remove EndpointProperties
`EndpointProperties` is a left over of the infrastructure in 1.x and is
no longer used. Besides the `endpoints.enabled` property is now
`endpoints.all.enabled`.

Closes gh-10016
2017-08-16 13:41:32 +02:00
Stephane Nicoll 151f7ef325 Reinstate JMX customizations of Endpoints ObjectName
This commit restores the configuration properties used to configure how
the ObjectName of an endpoint is generated. For consistency, those
properties have been renamed to `management.jmx`

Closes gh-10005
2017-08-16 13:37:24 +02:00
Andy Wilkinson 914b3588b0 Update test as response may be received before server has deleted file
Previously, the heap dump endpoint test asserted that the temporary
heap dump file had been deleted as soon as the client received a
response. This led to intermittent test failures as the input
stream is closed after its contents have been sent to the client,
creating a race condition between the client receiving the response
and then asserting that the file had been deleted and the server
close the input stream and deleting the temporary file.

This commit updates the test so that, after receiving the response, it
will wait for up to 5 seconds for the server to have deleted the
temporary heap dump file.
2017-08-11 20:26:09 +01:00
Andy Wilkinson 41e6b2adbe Improve diagnostics when temporary heap dump file can't be deleted 2017-08-11 18:57:56 +01:00
Andy Wilkinson e7a3b3c4e2 Polish 2017-08-11 18:46:05 +01:00
Andy Wilkinson cf2bf0c2b9 Work around javadoc bug when linking to annotation attributes
If an annotation attribute is linked to in javadoc before the
javadoc processor encounters a usage of the annotation, the javadoc
tool fails with a class cast exception. This is a known issue [1]
but it has been closed as won't fix so we need to work around it.
Sadly, the only reasonable way to do so appears to be to remove
the links to the annotation attributes and only link to the annotation
itself.

[1] https://bugs.openjdk.java.net/browse/JDK-8170447
2017-08-11 17:45:17 +01:00
Andy Wilkinson b49c1f6925 Pave the way for reworking the Actuator's CloudFoundry support
See gh-9996
2017-08-11 16:38:41 +01:00
Andy Wilkinson ee16332745 Update Actuator to use the new endpoint infrastructure
This commit migrates the Actuator onto the new endpoint infrastruture.
In addition to the existing support for accessing the endpoints via
JMX and HTTP using Spring MVC, support for access via HTTP using
Jersey and WebFlux has been added. This includes using a separate
management port where we now spin up an additional, appropriately
configured servlet or reactive web server to expose the management
context on a different HTTP port to the main application.

Closes gh-2921
Closes gh-5389
Closes gh-9796
2017-08-11 16:38:41 +01:00
Stephane Nicoll 7e97495cdf Expose Jolokia directly rather than via an endpoint
Jolokia is a 100% web concern and does not fit in the Endpoint
infrastructure. This commit removes `JolokiaMvcEndpoint` and exposes
the servlet directly instead while still being part of the
management context. As such, the Jolokia servlet is exposed beneath
the management context path and will move to a separate port when
the management port is not the same as the main server port.

Closes gh-9843
2017-08-11 13:12:30 +01:00
Andy Wilkinson 5351ceb673 Correct name of ManagementContextConfiguration in spring.factories
Closes gh-7545
2017-08-10 12:50:35 +01:00
Andy Wilkinson 0aa39d0279 Improve the package structure of spring-boot-actuator module
Closes gh-7545
2017-08-10 12:08:01 +01:00
Andy Wilkinson 63cd0afadb Merge branch '1.5.x' 2017-08-09 11:53:47 +01:00
Johnny Lim ee3de15e37 Add more ConditionalOnClass checks in HealthIndicatorAutoConfiguration
Closes gh-9940
2017-08-09 11:52:18 +01:00
Andy Wilkinson 7c52bb3a37 Improve the structure of the Liquibase endpoint's response
Closes gh-9974
2017-08-08 15:35:13 +01:00
Andy Wilkinson f38cb7b5d8 Improve structure of Flyway endpoint response, add missing properties
Closes gh-9973
2017-08-08 10:35:26 +01:00
Andy Wilkinson abf39915e8 Polish 2017-08-04 11:12:33 +01:00
Andy Wilkinson e9aeb9ad63 Polish 2017-08-04 11:00:36 +01:00
Madhura Bhave 3d878e642a Remove unused properties from tests 2017-08-01 10:24:47 -07:00
Madhura Bhave ea087b9bac Move liquibase config properties to spring.liquibase
Closes gh-9897
2017-08-01 10:24:47 -07:00
Madhura Bhave f9e316306a Move Flyway config properties to spring.flyway
Closes gh-9896
2017-08-01 10:24:47 -07:00
Andy Wilkinson bb55f49396 Remove concept of sensitivity from Actuator's endpoints
Closes gh-9924
2017-08-01 10:05:09 +01:00
Andy Wilkinson 8f42007aa1 Improve the structure of the response from the env endpoint
Closes gh-9864
2017-08-01 07:39:03 +01:00
Phillip Webb e1602fe59a Polish 2017-07-31 20:46:56 -07:00
Andy Wilkinson 37bef961ea Merge branch '1.5.x' 2017-07-31 15:33:18 +01:00
Andy Wilkinson 5a8a86375d Sanitize individual env entry that is matched exactly
Closes gh-9918
See gh-8282
2017-07-31 15:27:55 +01:00
Andy Wilkinson 9f75da9a8f Simplify the Actuator's hypermedia support
This commit replaces the Acuator's support for hypermedia with a
single endpoint that returns HAL-formatted links to all of the
available endpoints. This is done without requiring Spring HATEOAS
to be on the classpath in a similar manner to the existing
CloudFoundry discovery endpoint.

Closes gh-9901
2017-07-30 22:43:05 +01:00
Andy Wilkinson 4a61e45644 Require separate management port to use management context path of /
Closes gh-9898
2017-07-30 22:42:01 +01:00
Andy Wilkinson fb3d79c750 Drop support for self-hosted Actuator docs
Closes gh-9899
2017-07-29 09:19:53 +01:00
Phillip Webb 30ff329e3d Polish 2017-07-28 10:11:49 -07:00
Stephane Nicoll 92e48f6ee2 Fix build failure
This test definitely doesn't need Aspect processing since the project
doesn't have a dependency on `aspectjweaver`

Closes gh-9880
2017-07-28 13:43:58 +02:00
Stephane Nicoll b9b284d3d0 Merge branch '1.5.x' 2017-07-28 12:02:54 +02:00
Stephane Nicoll 5c13b8bf50 Separate custom schema configuration for Liquibase test
Unfortunately, creating the schema in code did not offer the right
condition to reproduce the error scenario. This commit restore the
initial intent, but separating the configuration and cleaning the
created context properly.

See gh-9862
2017-07-28 11:59:15 +02:00
Stephane Nicoll 7736cb1dc5 Fix test so that it doesn't leave a datasource hanging around
Closes gh-9862
2017-07-28 11:43:28 +02:00
Stephane Nicoll edee342d80 Merge branch '1.5.x' 2017-07-28 10:24:11 +02:00
Stephane Nicoll 7e21178f63 Polish "Use configured schema in Liquibase endpoint"
Closes gh-9862
2017-07-28 10:21:27 +02:00
Craig Andrews 3e13970fe0 Use configured schema in Liquibase endpoint
This commit makes sure that the Liquibase endpoint uses the configured
schema.

See gh-98£62
2017-07-28 10:21:27 +02:00
Phillip Webb 9127c48fb5 Fixup warnings 2017-07-27 16:39:49 -07:00
Spring Buildmaster 17a5bb0be4 Next development version 2017-07-27 08:00:21 +00:00
Phillip Webb 07556cda51 Restructure `boot.test.context` package
Split up `org.springframework.boot.test.context` into distinct packages
for `runner` and `assertj`.

See gh-9875
2017-07-26 17:47:59 -07:00
Phillip Webb 497457c397 Rename ApplicationContextTester -> Runner
Rename `ApplicationContextTester` and related classes to
`ApplicationContextRunner` and refactor existing tests to use correctly
named variables.

See gh-9875
2017-07-26 17:46:06 -07:00
Spring Buildmaster 41c5c0e7c9 Next development version 2017-07-26 08:30:55 +00:00
Emanuel Campolo 2626a3a795 Use lambdas when possible
Replace anonymous inner classes with lambda declarations (when possible
using method references).

See gh-9781
2017-07-25 00:53:38 -07:00
Emanuel Campolo 798fe5ed53 Collapse catch clauses
Use multi-catch for exceptions whenever possible.

See gh-9781
2017-07-25 00:53:37 -07:00
Emanuel Campolo 4a189bdee7 Replace Collections.sort() with direct sort call
Replace existing `Collections.sort(...)` calls with `.sort(...)`
directly on the collection instance.

See gh-9781
2017-07-25 00:53:37 -07:00
Emanuel Campolo 04fdec6f8b Replace explicit generics with diamond operator
Where possible, explicit generic declarations to use the Java 8 diamond
operator.

See gh-9781
2017-07-25 00:53:37 -07:00
Andy Wilkinson 6df1be3f1a Merge branch '1.5.x' 2017-07-22 08:22:35 +01:00
Johnny Lim d18e452fcd Use currentHealth consistently in getHealth()
Closes gh-9832
2017-07-22 08:21:43 +01:00
Andy Wilkinson d9837d7d1c Merge branch '1.5.x' 2017-07-21 17:31:53 +01:00
Andy Wilkinson bbc34a676c Polish "Handle possible regexes defensively in NamePatternFilter"
Closes gh-9730
2017-07-21 17:24:01 +01:00
dbego c29d1c756a Handle possible regexes defensively in NamePatternFilter
Previously, if a name contained part of a regex but wasn't actually
a regex, a PatternSyntaxException would be thrown and the request
would fail.

This commit updates NamePatternFilter to catch PatternSyntaxException
and treat the regex-like input as a name insteead.

See gh-9730
2017-07-21 17:21:49 +01:00
Phillip Webb e1ef2a591f Fixup tests to use new ApplicationContextTester
Update existing tests that previously use `ContextLoader` to the newly
introduced `*ApplicationContextTester` classes.

See gh-9634
2017-07-19 12:40:53 -07:00
Phillip Webb 9db72450da Merge branch '1.5.x' 2017-07-19 10:23:23 -07:00
Phillip Webb 68910f2b8f Polish 2017-07-19 10:21:06 -07:00
Phillip Webb cd23de6ed5 Add more HealthIndicatorAutoConfiguration ordering
Update HealthIndicatorAutoConfiguration to ensure that it is configured
after ActiveMQAutoConfiguration.

Fixes gh-9793
2017-07-19 10:19:42 -07:00
Stephane Nicoll 43e1df7752 Merge branch '1.5.x' 2017-07-19 15:45:14 +02:00
孙健 1745a5ee6f Fix metric check in case of duplicate metric
Closes gh-9497
2017-07-19 15:43:28 +02:00
Madhura Bhave b58923a42d Merge branch '1.5.x' 2017-07-17 11:27:08 -07:00
Madhura Bhave 0f8a819af9 Enable cors in default management security config
Fixes gh-9548
2017-07-17 10:49:48 -07:00
Phillip Webb 8e3baf3130 Polish 2017-07-11 13:57:21 -07:00
Stephane Nicoll cb13c98649 Polish 2017-07-08 15:36:18 +02:00
Stephane Nicoll fa71051ec6 Polish "Upgrade to Infinispan 9.0.3.Final"
Closes gh-9688
2017-07-08 15:30:13 +02:00
Stephane Nicoll ef5c2afcc9 Polish 2017-07-07 11:11:16 +01:00
Andy Wilkinson dd0ce54425 Improve the type-safety of ContextLoader for servlet and reactive web 2017-07-07 11:11:16 +01:00
Phillip Webb eb17aa06f9 Merge branch '1.5.x' 2017-07-06 18:38:52 -07:00
Phillip Webb aa57ca7e18 Polish 2017-07-06 16:53:04 -07:00
Andy Wilkinson 6db4330328 Prevent Elasticsearch from configuring Netty's available processors 2017-07-01 10:28:11 +01:00
Stephane Nicoll de2cdd8528 Use lettuce rather than Jedis for actuator tests 2017-06-30 15:44:15 +02:00
Stephane Nicoll 6e32f49630 Migrate HealthIndicatorAutoConfigurationTests to ContextLoader 2017-06-30 14:52:56 +02:00
Stephane Nicoll f2fe2c4dd5 Polish 2017-06-30 14:08:55 +02:00
Stephane Nicoll 8ea38d1cbe Merge branch '1.5.x' 2017-06-26 13:37:18 +02:00
Stephane Nicoll 88d16ddf6b Add missing class check
Closes gh-9602
2017-06-26 13:36:34 +02:00
Stephane Nicoll 01272fa0cc Polish "Add health indicator for Neo4j"
Closes gh-9557
2017-06-26 11:04:34 +02:00
Eric Spiegelberg 4c97dcb53a Add health indicator for Neo4j
See gh-9557
2017-06-26 10:31:02 +02:00
Andy Wilkinson 39c1757a96 Merge branch '1.5.x' 2017-06-21 14:31:21 -07:00
Andy Wilkinson 7a04708c41 Make sure the HealthMvcEndpoint is thread-safe
Previously, HealthMvcEndpoint stored the cached Health and its last
access time in two separate fields. Neither field was volatile and
no synchronization was used. This meant that there were potential
visibility problems. In a possible worst case scenario one field may
see the updated access time but an old health so it would incorrectly
believe that the old health was up-to-date and return it.

This commit reworks the endpoint to store the cached health and the
time at which it was created in a single, volatile field. This ensures
that the cached health and its creation time will be visible across
threads. Note that a race between threads when the cache is stale is
still possible. This race may result in multiple calls to the
delegate but these should be harmless.

Closes gh-9454
2017-06-21 14:19:10 -07:00
Stephane Nicoll 75274d3024 Merge branch '1.5.x' 2017-06-20 14:48:04 +02:00
Stephane Nicoll 3f70638f1c Polish "Use getUsableSpace() in DiskSpaceHealthIndicator"
Closes gh-9544
2017-06-20 14:44:11 +02:00
Huang YunKun 158416fdd0 Use getUsableSpace() in DiskSpaceHealthIndicator
See gh-9544
2017-06-20 14:43:38 +02:00
Andy Wilkinson 4a030d5a7a Drop support for auto-configuring an embedded Elasticsearch node
Elastic have announced [1] that embedded Elasticsearch is no longer
supported. This commit brings us into line with that announcement by
removing the auto-configuration that would create an Elasticsearch
Node and NodeClient.

To use the Elasticsearch auto-configuration, a user must now provide
the address of one or more cluster nodes
(via the spring.elastisearch.cluster-nodes property) which will then
be used to create a TransportClient.

See gh-9374

[1] https://www.elastic.co/blog/elasticsearch-the-server
2017-06-15 19:52:24 +01:00
Phillip Webb b94bb00fa1 Remove need for attached test-jar artifacts
Remove test-jar artifacts from Maven projects and relocate classes. The
majority of utilities now live in the `spring-boot-testsupport` module.

This update will help us to deploy artifacts using the standard Maven
deploy plugin in the future (which doesn't support the filtering of
individual artifacts).

Fixes gh-9493
2017-06-12 21:11:35 -07:00
Andy Wilkinson f7e9ec5f42 Minimise our usage of SocketUtils.findAvailableTcpPort
Closes gh-9382
2017-06-09 14:45:09 +01:00
Spring Buildmaster 05d4d0281c Next Development Version 2017-06-08 12:47:16 +00:00
Andy Wilkinson a72c1b2cba Merge branch '1.5.x' 2017-06-07 14:02:46 +01:00
Andy Wilkinson 9579e95868 Handle explicit disablement of management SSL correctly
Closes gh-9423
2017-06-07 13:57:59 +01:00
Phillip Webb 2c7dd9f519 Polish 2017-06-02 16:00:39 -07:00
Phillip Webb b9fd99e268 Polish 2017-06-02 13:47:28 -07:00
Stephane Nicoll 605dee4700 Allow to reset a log level
This commit ensures that `setLogLevel` on the `LoggingSystem` accepts
a `null` level. A `null` level means any customization sets on that
level should be removed and the default configuration should be used
instead.

Effectively, the level of the parent logger is going to be used when
`setLevel` is called with `null` for a given logger.

Most JMX clients do not accept to pass `null` for an argument so an
empty String is translated to null in that specific case.

Closes gh-8776
2017-06-01 14:31:07 +02:00
Stephane Nicoll bdf2b2e810 Merge branch '1.5.x' 2017-06-01 13:38:03 +02:00
Stephane Nicoll 9fc90a809f Add missing @Test annotations 2017-06-01 13:37:05 +02:00