Since SPR-15415 and SPR-15435, the HandlerStrategies and its companion
builder are now using the new CodecConfigurer infrastructure to
configure codecs in a cross-cutting way.
This commit looks for a custom instance of `HandlerStrategies.Builder`
provided by the user, or create a default one if none was found.
Fixes gh-8897
This commit makes sure to honour the `spring.aop.proxy-target-class`
property if set by the user. Previously, the
`PersistenceExceptionTranslationPostProcessor` was always configured to
use cglib, regardless of the value of that property.
Closes gh-8887
This commit separates the JPA-specific bits of the batch
auto-configuration so that it is possible to reuse most of the logic if
JPA isn't available at all.
Closes gh-8877
This commit makes sure to honour the `spring.aop.proxy-target-class`
property if set by the user. Previously, the
`MethodValidationPostProcessor` was always configured to use cglib,
regardless of the value of that property.
Closes gh-8869
Previously, as a result of the changes made in de50cfa21e, an
application would fail to start on Google AppEngine as it prevents
the creation of new threads.
This commit updates OnClassCondition so that it falls back to
performing the work on the main thread when its unable to shift it
to a separate thread.
Closes gh-8584
When used as a meta-annotation the value() attribute of
@ConditionalOnClass will fail silently resulting in the @Conditional
nature of the annotation being ignored.
See gh-8185
Previously, WelcomePageHandlerMapping would forward to index.html.
This assumed that the static path pattern was always /**. If it had
been customised to, for example, /foo/**, then the forward would still
be to index.html and a 404 would result as the page is actually
available at /foo/index.html.
At first glance, it would appear that the forward should be made to
foo/index.html. However, as it's a forward rather than a redirect,
any relative URLs in the index.html page would then be resolved using
/ whereas they should be resolved using /foo/. This could be addressed
by using a redirect rather than a forward, but we don't want to do
that as it's more invasive and would require a roundtrip back to the
client. Instead, this commit simply stops performing the forward when
the static path pattern is not /**.
Closes gh-8788
This commit makes sure that `@EnableTransactionManagement` is
auto-configured with Neo4j. It actually reuses what was done in #8434,
making sure that the `Neo4jDataAutoConfiguration` is ordered properly.
Closes gh-8587
Previously to this commit, transaction management was only enabled when
a `DataSource` is configured. The processing of `@Transactional`
annotations are now enabled as long as a `PlatformTransactionManager` is
present.
Also, the `spring.aop.proxy-target-class` is now honoured if set, still
defaulting to CGLIB mode.
Closes gh-8434
As part of the upgrade, this commit removes the use of any API that
has been deprecated in 2.9. This includes the config props endpoint's
use of SerializationFeature.WRITE_NULL_MAP_VALUES. This has been
replaced with configuring serialization inclusion to only include
properties with non-null values. This means that all null-valued
properties will no longer be serialized, not just those that are an
entry in a map.
Closes gh-8604
Closes gh-8537
Closes gh-7695
This commit our Neo4j OGM dependency with the Spring Data Neo4j
snapshots that are currently included in snapshots of Spring Data Kay.
It switches to using Neo4j's Bolt driver by default, aligning it with
the default of the latest Spring Data Neo4j 5 snapshots.
It also contains a workaround for a Neo4j OGM issue [1] and a change
to Neo4jDataAutoConfigurationTests that prevents the entire classpath
from being scanned.
See gh-8687
[1] https://github.com/neo4j/neo4j-ogm/issues/340
As part of the upgrade, this commit removes the use of any API that
has been deprecated in 2.9.0.pr1. This includes the config props
endpoint's use of SerializationFeature.WRITE_NULL_MAP_VALUES. This
has been replaced with configuring serialization inclusion to only
include properties with non-null values. This means that all
null-valued properties will no longer be serialized, not just those
that are an entry in a map.
Closes gh-8604
Closes gh-8537
Restructure `org.springframework.boot.autoconfigure.web` to better align
with the new package structure in `spring-boot`.
Auto-configuration is now split into client, servlet and reactive
sub-packages. In addition a new `http` package now handles common
HTTP concerns.
Fixes gh-8616
Separate logging ApplicationListeners classes to a different package
so that the root `logging` package is no longer aware of `context`
concerns.
Fixes gh-8611
Rework `org.springframework.boot.context.embedded` to relocate classes
to `org.springframework.boot.web`. Packages are now organized around
the following areas:
Packages for shared concerns, for example the `WebServer` interface
to start/stop a server and the common configuration elements:
- org.springframework.boot.web.context
- org.springframework.boot.web.server
Servlet specific packages:
- org.springframework.boot.web.servlet.server
- org.springframework.boot.web.servlet.context
- org.springframework.boot.web.servlet.filter
Reactive specific packages:
- org.springframework.boot.web.reactive.context
- org.springframework.boot.web.reactive.server
Embedded server implementations (both reactive and servlet):
- org.springframework.boot.web.embedded
In addition:
- Rename `EmbeddedServletContainerFactory` to `ServletWebServerFactory`
to align with the `ReactiveWebServerFactory`.
- Rename `EmbeddedWebApplicationContext` to
`ServletWebServerApplicationContext` and
- Rename `EmbeddedReactiveWebApplicationContext` to
`ReactiveWebServerApplicationContext`.
- Add checkstyle rules to restrict imports.
- Fixup all affected code to use the correct imports and local names.
Fixes gh-8532
This commit makes sure that if a `javax.cache.CacheManager` is required,
an auto-configured `HazelcastInstance` is fully resolved first. This
prevents the case where the JCache bootstrap actually starts an instance
early, followed by a second (potentially unwanted) instance created by the
regular auto-configuration.
Since the JCache implementation works with an `HazelcastInstance` behind
the scenes, if there is one `HazelcastInstance` configured and it has a
name, then we configure the `CacheProvider` to use that. Future Hazelcast
version will allow to pass the instance directly (i.e. not requiring an
actual name).
Closes gh-8484
This commit flags the `BeanPostProcessor` registered by the reactive
embedded support as `synthetic` so that it doesn't trigger an early
initialization of other components.
See gh-8467
This commit flags the two `BeanPostProcessors` registered by the
embedded support as `synthetic` so that they don't trigger an early
initialization of other components.
Closes gh-8467
Remove the creation of a separate `HazelcastInstance` specific to caching.
Instead, the general `HazelcastAutoConfiguration` is used and if a
`HazelcastInstance` bean is present we wrap it in a `CacheManager`.
Closes gh-8470
The additional configuration for an `HazelcastInstance` will be removed
in 2.0. This commit makes sure that the property is deprecated in 1.5
See gh-8470
As of Hazelcast 3.7, the bootstrap is pretty slow by default due to the
networking discovery. This commit disables both TCP/IP and multicast
discoveries.
This commit makes sure that if `local.mongo.port` is set, a `MongoClient`
on the embedded MongoDB instance is created. When an embedded instance
is detected, only the `host` property is used and the `uri` is ignored if
set.
This makes sure that the auto-configured `MongoClient` automatically
switches to the embedded server, even if a production uri has been
specified.
Closes gh-8219
Update DataSourceInitializedPublisher to always attempt to obtain the
published DataSource directly from the EntityManager. In the case where
the EntityManager doesn't provide a DataSource, the previous logic is
used.
Fixes gh-8296
This commit makes sure that if a `Validator` is auto-configured, it is
reused as the `webFluxValidator`. This is pretty much the same thing as
what was done recently for Spring MVC.
Since the infrastructure is now shared, the package protected class has
been published in the `.validation` package.
Closes gh-8400
An `HttpHandler` bean must be provided once the infrastructure triggered
by `@EnableWebFlux` has been processed. Rather than creating a
`HttpHandler` in that auto-configuration, this commit moves it to a
dedicated auto-config, like we do for `DispatcherServlet` for
servlet-based webapps.
As this is the only bean we auto-configure in a functional fashion, the
`WebFluxFunctionalAutoConfiguration` is now merged with this new
auto-configuration, making its purposes clearer.
Cloess gh-8436
Rework Spring MVC JSR-303 validation support a little more to move
most of the creation logic to the wrapper class. Also rename
`SpringValidatorAdapterWrapper` -> `WebMvcValidator`.
See gh-8223
This commit improves the initial solution by actually overriding the
`mvcValidator` `@Bean`. This gives us more control as whether a custom
validator has been specified or not. We now wrap it regardless of it
being custom or provided by auto-configuration.
Closes gh-8223
`MethodValidationPostProcessor` requires a `Validator` so we need to flag
it as an infrastructure bean to prevent an additional log that indicates
it won't be post-processed.
We obviously don't want to post-process the `Validator` here so adding the
additional meta-data is a good idea anyway.
Closes gh-8422
This commit add mock support for WebFlux with an infrastructure similar
to what `WebMvcTest` provides. `@WebFluxTest` can be used to test
controllers with a narrowed classpath that is relevant to WebFlux. Also,
`@SpringBootTest` now starts WebFlux in "mock" mode by default and
`@AutoConfigureWebTestClient` can be used to inject a `WebTestClient`
connected to the `ApplicationContext`.
To make that happen, a `ReactiveWebApplicationContext` interface has been
introduced to mirror what `WebApplicationContext` currently does. Things
are still a bit volatile at this point and that infra may move to Spring
Framework at some point.
Closes gh-8401
The server's session can now be configured in both a servlet and a
reactive environment. The latter has not requirement on the servlet API
and this commit removes the requirement to the `SessionTrackingMode`
enum.
Closes gh-8402
This commit creates auto-configuration classes for both the
annotation and functional variants of the WebFlux framework.
They provide the basic support to get started with those, by
creating the required `HttpHandler` using the provided application
context (for annotation) or `RouterFunction`s (for functional).
They do support `WebFilter` registration and a few advanced
features such as resource handling, `messageReaders|Writers`
and `ViewResolver` auto-registration.
Closes gh-8386
This commit adds the auto-configuration for creating reactive
`EmbeddedWebServer` instances. This adds support for the
following servers: Reactor Netty, Tomcat, Jetty and Undertow.
Fixes gh-8302
Fixes gh-8117
This commit adds an `EmbeddedWebServer` instance to the
`ReactiveWebApplicationContext` and ties it to the application
lifecycle.
To launch a reactive web application, two elements are required
from the context:
* a `ReactiveWebServerFactory` to create a server instance
* a `HttpHandler` instance to handle HTTP requests
Closes gh-8337
This commit adds the infrastructure for creating and customizing
reactive embedded web servers. Common configuration has been refactored
into the new `ConfigurableEmbeddedWebServer` interface.
See gh-8302
This commit makes sure that the Spring `Validator` used by the MVC
layer doesn't expose a JSR-303 contract, if any.
The default implementation of the `mvcValidator` is
`LocalValidatorFactoryBean`. While this object is exposed as a Spring
`Validator` only, its runtime capabilities expose that contract as well
as the standard `Validator` and `ValidatorFactory` ones.
Concretely, if an auto-configuration is checking if a
`javax.validation.Validator` bean is missing, the condition will match
since we only know about "advertized types": beans haven't been created
yet so we can't inspect their runtime capabilities. Since the condition
match, we will auto-configure a bean. At runtime though, we're no longer
ale to inject a `javax.validation.Validator` by type since two candidates
are available.
This commit introduces `SpringValidatorAdapterWrapper`, a wrapper class
on any `SpringValidatorAdapter` (`LocalValidatorFactoryBean` being one of
the available implementations) that only exposes the Spring contract.
Also, if a `javax.validation.Validator` bean is available, we will use it
for the MVC layer, rather than creating a new one.
Closes gh-8223
- Apply standard code formatting
- Add class javadoc to MultipleResourceServerConfigurationTests
- Add missing @Override annotations
- Remove unused ExpectedException field
- Remove use of SpringApplicationBuilder from the tests
- Use @ImportAutoConfiguration to import auto-configuration
- Add assertions to verify that the orders haven't been changed
- Remove unnecessary mocking of EmbeddedServletContainerFactory
See gh-8347
The verifier's type checker is required to check that a type returned
from a method (an areturn instruction) is assignable to the method's
declared return type. When the return type is an interface, the JLS
states that it should be treated as java.lang.Object. This means that
no analysis of the type being returned is required and verification
passes. When the return type is a class, the type being returned must
be analyzed to ensure that it is compatible. This analysis causes the
return type to be loaded during verification.
Prior to this commit, BasicBatchConfigurer's
createAppropriateTransactionManager method had a return type of
AbstractPlatformTransactionManager and a branch that could return
a JpaTransactionManager. This caused the verifier to attempt to load
JpaTransactionManager so that it could check that it was assignable
to AbstractPlatformTransactionManager. This would fail when
spring-orm is not on the classpath as JpaTransactionManager could not
be loaded.
This commit updates BasicBatchConfigurer to change the return type
of createAppropriateTransactionManager so that it returns a
PlatformTransactionManager which is an interface. As described above,
this relaxes the verification of any areturn instructions in the
method and, in this particular case stops the verifier from trying to
load JpaTransactionManager.
Closes gh-8181
Add autoconfiguration to bootstrap MongoDB Reactive Streams driver
components, reactive Spring Data MongoDB and reactive repositories. Add
bean dependency processor for flapdoodle so embedded MongoDB instances
are configured before bootstraping the reactive MongoDB client.
Add Spring Data MongoDB Reactive starter with blocking and non-blocking
dependencies. MongoDB requires a separate driver that is used in the
`ReactiveMongoTemplate` while `MappingMongoConverter` (shared amongst
blocking/reactive Template API) requires the blocking driver to resolve
DBRefs.
See gh-8230
This commit improves `SimpleRabbitListenerContainerFactoryConfigurer` to
use a custom `MessageConverter`. If such a bean is present, it is used
for the default factory that is auto-configured.
Closes gh-8194
This commit qualifies the `CustomConversions` bean name that the Mongo
auto-configuration might create. `CustomConversions` is a common pattern
in Spring Data and other stores are using the same name.
See https://jira.spring.io/browse/DATASOLR-362
Closes gh-8225
This commit creates a separate
`ServerPropertiesServletContainerCustomizer` that holds the servlet
container customization code, separating that concern from the server
configuration keys.
See gh-8066
Previously, SocialWebAutoConfiguration would create a
SpringSocialDialect bean when SpringTemplateEngine was on the
classpath. This class exists in both Thymeleaf 2 and Thymeleaf 3 but
SpringSocialDialect is only compatible with Thymeleaf 2.
This commit updates the auto-configuration to require
SpringResourceResourceResolver to be on the classpath. This class
exists in Thymeleaf 2 but does not exist in Thymeleaf 3.
Closes gh-4858
This commit refactors the `ServerProperties` property keys and
introduces a separate "server.servlet" namespace to isolate
servlet-specific properties from the rest.
Closes gh-8066
This commit improves `@ConditionalOnWebApplication` to specify the
requested web application type. By default, any web application will
match but it can also match only if a recactive (or servlet) web
application is present.
Closes gh-8118
Previously, if a builder was created with an empty condition, an extra
space was added before the message. This commit checks for this
particular case and adds a space only when necessary.
Closes gh-8218
This contract is not specific to servlet containers and should be
reused by all web server implementations (including reactive variants).
Fixes gh-8208
Previously ConditionalOnBean was the inverse of
ConditionalOnMissingBean. This meant that the former was a logical OR
while the latter was a logical AND of the requiremnts declared via the
annotation's attributes.
This commit changes the logic for ConditionalOnBean so that it is now
a logical AND. A side-effect of this change is that more information
about what has and has not matched must be tracked during the
evaluation. This extra information is now used to provide more
informative messages in the condition evaluation report that indicate
exactly why @ConditionalOnBean or @ConditionalOnMissingBean did not
match.
Closes gh-5279
This commit removes `ServerProperties` and `ManagementServerProperties`
auto-configurations. Those properties objects are now created using
`@EnableConfigurationProperties` only.
Closes gh-8108
Dependency management for the `HikariCP-java6` dependency is no longer
needed since Java 6 is no longer supported by Spring Boot.
The HikariDriverConfigurationFailureAnalyzer has been updated with the
current message thrown by HikariCP in this failure scenario.
Closes gh-8147
SI 5 has made IntegrationComponentScanRegistrar more extensible by
offering a method for getting the back packages that can be
overridden.
This commit takes advantage of that change by removing our creation
of "fake" annotation metadata and overriding getBackPackages to return
the auto-configuration packages instead.
Closes gh-7744
Update `ImportsContextCustomizer` so that whenever possible a more
specific cache key is used.
Prior to this commit the customizer would generate a key based on *all*
annotations on the test class. This has repeatedly caused issues where
test classes that should have the same cache key did not due to
unrelated annotations.
A new `DeterminableImports` interface has been added that can be
implemented by `ImportSelector` and `ImportBeanDefinitionRegistrar`
implementations that are able to determine their imports early. The
existing `ImportAutoConfigurationImportSelector` and
`AutoConfigurationPackages` classes have been retrofitted with
this interface.
Fixes gh-7953
Previously, Hibernate Validator would fail to initialize if it was
on the classpath but an EL implementation was not.
OnValidatorAvailableCondition protected against this scenario by
initializing the validator.
The Hibernate Validator shortcoming was addressed in eb222209
(gh-7598). As a result, checking for the precences of the
ValidationProvider META-INF/services resource is now sufficient to
auto-configure validation. This commit removes
OnValidatorAvailableCondition as it is no longer necessary.
Closes gh-8110
This commit provides auto-configuration for the Reactor Core 3 library.
A new configuration namespace, "spring.reactor" allows to configure
hooks on operators, like "spring.reactor.stacktrace-mode.enabled".
This property is enabled automatically by devtools, since it improves
the developer experience and provides full stacktrace information when
exceptions occur (but at a performance cost).
Fixes gh-7302
In version 2.3.6 and earlier, an attempt to create a Bucket or a
ClusterInfo would fail fast with a ConnectException in the cause of
the Couchbase server was done. In 2.3.7 this remains true for a
Bucket but is no longer the case for ClusterInfo. The latter now
retries for 75 seconds by default and when it eventually fails a
ConnectException is no longer part of the cause chain.
This commit makes the auto-configured ClusterInfo depend on the
auto-configured Bucket. This means that the Bucket is always created
before the ClusterInfo, thereby ensuring that things fail gracefully
with useful diagnostics when the server is unavailable.
Closes gh-8092
This commit raises the minimum supported version of Thymeleaf to
3.0.x. It also upgrades Spring Social to a version that is compatible
with Thymeleaf 3.
Closes gh-7450
Closes gh-6258
See gh-7885
Update OnClassCondition to implement AutoConfigurationImportFilter so
that auto-configuration candidates can be filtered early. The
optimization helps to improve application startup time by reducing
the number of classes that are loaded.
See gh-7573
Optimize `AutoConfigurationSorter` by used properties generated by the
annotation processor whenever possible. The removes the need for each
candidate class to be ASM parsed just to access the order annotations.
See gh-7573
Add AutoConfigurationMetadata interface and a an internal loader that
allows easy access to data written by `spring-boot-configure-processor`.
See gh-7573
Add an annotation processor that generates properties files for certain
auto-configuration class annotations. Currently attribute values from
@AutoConfigureOrder, @AutoConfigureBefore, @AutoConfigureAfter and
@ConditionalOnClass annotations are stored.
The properties file will allow optimizations to be added in the
`spring-boot-autoconfigure` project. Primarily by removing the need
to ASM parse as many `.class` files.
See gh-7573
Update `AutoConfigurationImportSelector` so that exclude properties
are loaded without invoking a `DataBinder`. This optimization helps
to improve application startup time.
See gh-7573
Update `OnBeanCondition` to no longer call `ReflectionUtils` when
deducing the bean method return type. Since Spring Framework 4.2
the return type has been directly available from `MethodMetadata`.
See gh-7573
Update `OnClassCondition` to use its own `isPresent` rather than using
`ClassUtils.isPresent`. Using our own implementation saves a few cycles
since we never need to check for native types, and we don't support
nested class references specified in the non `$` notation.
See gh-7573
Remove the slightly unusual dependency from the root autoconfigure
pacakge to `condition`. Prior to this commit the link was required in
ordere to populate the `ConditionEvaluationReport`. We now introduce
a `AutoConfigurationImportListener` strategy that allows anyone to
listen for AutoConfigurationImportEvents. The listener implementation
is now used to update the ConditionEvaluationReport.
Fixes gh-8073
Rename EnableAutoConfigurationImportSelector to the more general
AutoConfigurationImportSelector since it's now used for more than
just the enable annotation.
The existing EnableAutoConfigurationImportSelector class remains in
a deprecated form so that it can be made package-private again in
Spring Boot 2.0.
Fixes gh-8072
This commit improves the logic of the embedded Mongo support to use a
random port if no custom port has been specified. This doesn't change
the default if the embedded support isn't active.
Closes gh-8044
Previously, the actuator's endpoints produced application/json and,
where appropriate, also consumed application/json. Without a custom,
versioned media type, it's impossible for us to make changes to the
endpoints without breaking clients.
This commit introduces a new media type,
application/spring-boot.actuator.v1+json, that is now produced by
default with application/json also being produced if requested.
Endpoints that consume JSON will now also accept content the uses
the new media type in addition to application/json.
Closes gh-7967
Previously, SpringBootApplication relied on implicity aliasing of
exclude and excludeName that worked because the two attributes have
the same names as the equivalent attributes on
EnableAutoConfiguration.
This commit updates SpringBootApplication to make the aliases explicit
and also adds tests to EnableAutoConfigurationImportSelectorTests to
verify that the aliasing is working as intended.
Closes gh-7951
Replace JSR-330 validation annotations from all internal
`@ConfigurationProperties` classes with standard Asserts.
Prior to this commit validation of our own configuration properties
would only occur when the user happens to have compliant JSR-330
implementation on their classpath.
See gh-7579
This commit provides an order of zero for the RepositoryRestConfigurer
that is used internally to configure the `RepositoryRestConfiguration`. In
practice, an unordered `RepositoryRestConfigurer` will run after ours.
Closes gh-7981
Previously, OAuth2MethodSecurityConfiguration set the
PermissionEvaluator on the expression evaluator by looking in the
context for a PermissionEvaluator bean. This is unnecessary as
GlobalMethodSecurityConfiguration already does the same thing and does
so after the post-processor in OAuth2MethodSecurityConfiguration has
run. This commit removes the redundant logic and adds tests to check
that both the PermissionEvaluator and the RoleHierarchy are set use
beans in the context.
Closes gh-7979
The default is now SecurityProperties.ACCESS_OVERRIDE_ORDER-1
(instead of 3), and the user can set it with
security.oauth2.resource.filter-order (as opposed to being hard
coded). The filter is provided by Spring OAuth2 so this change is
a BeanPostProcessor to call a setter on that object.
Fixes gh-5072
Upgrade to `hibernate-validator` 5.3.4 and introduce a new
`MessageInterpolatorFactory` that creates a suitable
`MessageInterpolator` (taking into account missing EL dependencies).
Rework `ConfigurationPropertiesBindingPostProcessor` and
`ValidationAutoConfiguration` to make use of the new factory.
Fixes gh-7598
This commit removes the automatic enabling of Redis as the Spring Session
store when it is available. This case is covered by a warning in `1.4.x`
that this commit removes as well.
Closes gh-7858
Previously, property `spring.jpa.database` should be provided. This
commit allows to detect the database when `spring.datasource.url` is
provided.
Closes gh-7708
Update `ImportAutoConfigurationImportSelector` to ignore excludes for
classes that aren't loaded. Since the import classes for tests tend to
be much more limited, the exception isn't really helpful.
Closes gh-6809
Update `CacheManagerCustomizers` to deal directly with
`ClassCastException` assuming that they are because a customizer is
implemented using a lambda.
Closes gh-7788
Update `CacheManagerCustomizers` to deal directly with
`ClassCastException` assuming that they are because a customizer is
implemented using a lambda.
Closes gh-7788
Update `@ImportAutoConfiguration` with support for an exclude attribute
that works in a similar way to `@EnableAutoConfiguration`.
Also update existing `@Test...` annotation with exclude attribute
aliases.
Fixes gh-6809
Update `TransactionManagerCustomizers` to deal directly with
`ClassCastExceptions` assuming that they are because a customizer is
implemented using a lambda.
See gh-7561
Add a `TransactionManagerCustomizer` callback interface that can be
used to customize auto-configured `PlatformTransactionManagers`.
Also update `...transaction.*` properties under a single unified
`spring.transaction...` key since the existing auto-configurations
would often share a transaction manager (the technology specific
transaction managers are `@ConditionalOnMissingBean` and may use
a manager created by a previous auto-configuration).
See gh-7561
Consistently use the simple name for ObjectProvider parameter and
field names. For example:
`ObjectProvider<Something> something`
rather than
`ObjectProvider<Something> somethingProvider`
Since the `JestClient` is auto-configured as a bean, it must have its
multi-threaded support enabled by default. This commit exposes a new
`spring.elasticsearch.jest.multi-threaded` property that is `true` by
default.
Closes gh-6806
Rework cb3d14a so that the customizer operates on the Builder rather than
the Cluster. The former exposes many more options.
See gh-7320
Closes gh-7669
Update Spring Integration auto-configuration so that
`@IntegrationComponentScan` from `AutoConfigurationPackages` is
implicitly applied. Prior to this commit `@MessagingGateway` interfaces
would only get picked up if `@IntegrationComponentScan` was added
alongside with the `@SpringBootApplication`.
Fixes gh-2037
Closes gh-7718
Update Spring Integration metrics support since Spring Integration
`4.3.6`+ no longer needs `spring-integration-jmx` enable
`MessageChannel`, `MessageHandler` and `MessageSource` metrics.
- Add `IntegrationManagementConfiguration` conditional auto-configuration
to provide `@EnableIntegrationManagement` when JMX is `enabled` or there
is no `IntegrationManagementConfigurer.MANAGEMENT_CONFIGURER_NAME` bean.
By default this bean doesn't exist and you explicitly should declare it
(e.g. via `@EnableIntegrationManagement`) if you would like to collect
metrics. At the same time Spring Integration enables it when JMX
management is present (that is a purpose of that new
`IntegrationManagementConfiguration`)
- Change `SpringIntegrationMetricReader` to read metrics from the
`IntegrationManagementConfigurer`, not `IntegrationMBeanExporter`
- Change `PublicMetricsAutoConfiguration` to register
`IntegrationManagementConfigurer.MANAGEMENT_CONFIGURER_NAME` bean if
not present. Since we are here in `actuator`, therefore we are
interested in the metrics for SI as well.
- Since we don't need JMX for the metrics any more, remove SI-JMX
dependency from the `spring-boot-starter-integration`.
- Remove `IntegrationManagementConfiguration` modification from the
`integrationMbeanExporter()`, since that looks like mutation of an
external object, when end-user would prefer their own options.
Therefore we don't need `ObjectProvider<IntegrationManagementConfigurer>`, too
- Add missed `MessageSourceMetrics` gathering for the
`SpringIntegrationMetricReader`
Closes gh-7722
Update KafkaProperties since Apache Kafka `0.10.1` changed the type
for the `ConsumerConfig.AUTO_COMMIT_INTERVAL_MS_CONFIG` from the
`Long` to `Integer`.
Kafka includes the following conversion logic:
case LONG:
if (value instanceof Integer)
return ((Integer) value).longValue();
if (value instanceof Long)
return (Long) value;
else if (value instanceof String)
return Long.parseLong(trimmed);
So we remain compatible with both `0.10.0` and `0.10.1`
Closes gh-7723
By configuring security.oauth2.client.grantType=client_credentials the
user signals that (even in a web application) he doesn't want to use
the auth code grant (and hence session and request scoped beans for
client context).
This commit improves ValidationAutoConfiguration so that a `Validator`
bean is exposed if JSR 303 is available. This has the side effect of
automatically enable Spring Data Couchbase's entity validation rather
than requiring to expose a `Validator` bean.
Closes gh-5178
Previously, ValidationAutoConfiguration would configure a
MethodValidationPostProcessor if any Bean Validation 1.0 or later
implementation was available, however the underlying infrastructure
requires Bean Validation 1.1 with any implementation or
Bean Validation 1.0 with Hibernate Validator 4.3.
This caused a problem on TomEE which uses Apache BVal, and Bean
Validation 1.0 implementation. Spring Framework would identify that
Bean Validaton 1.0 was being used and then try to load Hibernate
Validator classes that are not present.
This commit fixes the problem by requiring Bean Validation 1.1 before
auto-configuring a MethodValidationPostProcessor.
Closes gh-7665
Update `SpringBootWebSecurityConfiguration` to ignore requests by
delegating to `IgnoredRequestCustomizer` beans. This allows a single
Spring Boot `WebSecurityConfigurer<WebSecurity>` bean to be used which
prevents potential exceptions caused by duplicate `@Order` values.
Fixes gh-7106
Previously, if a user specifies a path to a schema or data DDL that does
not exist, the application will start up fine and the missing DDL would
not be reported.
This commit validates that user-defined resources actually exist and
throw a new `ResourceNotFoundException` if they don't.
Closes gh-7088
Previously, if `spring.couchbase.bootstrap-hosts` was specified in YAML
or with the `[Idx]` notation, the auto-configuration would not kick in.
This is due to a limitation of `@ConditionalOnProperty` on a property of
type Collection. This commit workarounds this limitation for now with a
dedicated condition.
Closes gh-7508