Skip to content

Commit 159619d

Browse files
artembilangaryrussell
authored andcommitted
Use @Configuration(proxyBeanMethods=false) (#1174)
* Use `@Configuration(proxyBeanMethods=false)` Related to spring-projects/spring-integration#2988 For faster startup (and possibility to compile to native code with GraalVM) use a `proxyBeanMethods = false` on all the `@configuration` classes in the Framework * Provide some other code style polishing * * Upgrade dependencies, including Gradle * More `exclude group: 'org.springframework'`
1 parent 0286e66 commit 159619d

File tree

7 files changed

+52
-18
lines changed

7 files changed

+52
-18
lines changed

build.gradle

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
buildscript {
2-
ext.kotlinVersion = '1.3.31'
2+
ext.kotlinVersion = '1.3.40'
33
repositories {
44
maven { url 'https://repo.spring.io/plugins-release' }
55
}
66
dependencies {
77
classpath 'org.asciidoctor:asciidoctorj-pdf:1.5.0-alpha.18'
88
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
99
classpath "org.jetbrains.kotlin:kotlin-allopen:$kotlinVersion"
10-
classpath 'io.spring.nohttp:nohttp-gradle:0.0.2.RELEASE'
1110
}
1211
}
1312

@@ -18,6 +17,7 @@ plugins {
1817
id "org.sonarqube" version '2.7.1'
1918
id 'org.asciidoctor.convert' version '1.6.1'
2019
id 'org.ajoberstar.grgit' version '3.1.1'
20+
id "io.spring.nohttp" version "0.0.3.RELEASE"
2121
}
2222

2323
apply plugin: 'io.spring.nohttp'
@@ -84,11 +84,11 @@ subprojects { subproject ->
8484
jacksonVersion = '2.9.9'
8585
jaywayJsonPathVersion = '2.4.0'
8686
junit4Version = '4.12'
87-
junitJupiterVersion = '5.5.0'
88-
junitPlatformVersion = '1.5.0'
87+
junitJupiterVersion = '5.5.1'
88+
junitPlatformVersion = '1.5.1'
8989
kafkaVersion = '2.3.0'
90-
log4jVersion = '2.11.2'
91-
mockitoVersion = '2.28.2'
90+
log4jVersion = '2.12.0'
91+
mockitoVersion = '3.0.0'
9292
scalaVersion = '2.12'
9393
springRetryVersion = '1.2.4.RELEASE'
9494
springVersion = '5.2.0.BUILD-SNAPSHOT'
@@ -232,7 +232,7 @@ project ('spring-kafka') {
232232
compile "org.springframework:spring-messaging:$springVersion"
233233
compile "org.springframework:spring-tx:$springVersion"
234234
compile ("org.springframework.retry:spring-retry:$springRetryVersion") {
235-
exclude group: 'org.springframework', module: 'spring-core'
235+
exclude group: 'org.springframework'
236236
}
237237
compile "org.apache.kafka:kafka-clients:$kafkaVersion"
238238
compile ("org.apache.kafka:kafka-streams:$kafkaVersion", optional)
@@ -263,7 +263,9 @@ project ('spring-kafka-test') {
263263
dependencies {
264264
compile "org.springframework:spring-context:$springVersion"
265265
compile "org.springframework:spring-test:$springVersion"
266-
compile "org.springframework.retry:spring-retry:$springRetryVersion"
266+
compile ("org.springframework.retry:spring-retry:$springRetryVersion") {
267+
exclude group: 'org.springframework'
268+
}
267269

268270
compile "org.apache.kafka:kafka-clients:$kafkaVersion:test"
269271
compile "org.apache.kafka:kafka-streams:$kafkaVersion"

gradle/wrapper/gradle-wrapper.jar

426 Bytes
Binary file not shown.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-5.2.1-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-5.5.1-bin.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

gradlew

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,21 @@
11
#!/usr/bin/env sh
22

3+
#
4+
# Copyright 2015 the original author or authors.
5+
#
6+
# Licensed under the Apache License, Version 2.0 (the "License");
7+
# you may not use this file except in compliance with the License.
8+
# You may obtain a copy of the License at
9+
#
10+
# https://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing, software
13+
# distributed under the License is distributed on an "AS IS" BASIS,
14+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
# See the License for the specific language governing permissions and
16+
# limitations under the License.
17+
#
18+
319
##############################################################################
420
##
521
## Gradle start up script for UN*X
@@ -28,7 +44,7 @@ APP_NAME="Gradle"
2844
APP_BASE_NAME=`basename "$0"`
2945

3046
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
31-
DEFAULT_JVM_OPTS='"-Xmx64m"'
47+
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
3248

3349
# Use the maximum available, or set MAX_FD != -1 to use that value.
3450
MAX_FD="maximum"

gradlew.bat

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
@rem
2+
@rem Copyright 2015 the original author or authors.
3+
@rem
4+
@rem Licensed under the Apache License, Version 2.0 (the "License");
5+
@rem you may not use this file except in compliance with the License.
6+
@rem You may obtain a copy of the License at
7+
@rem
8+
@rem https://www.apache.org/licenses/LICENSE-2.0
9+
@rem
10+
@rem Unless required by applicable law or agreed to in writing, software
11+
@rem distributed under the License is distributed on an "AS IS" BASIS,
12+
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
@rem See the License for the specific language governing permissions and
14+
@rem limitations under the License.
15+
@rem
16+
117
@if "%DEBUG%" == "" @echo off
218
@rem ##########################################################################
319
@rem
@@ -14,7 +30,7 @@ set APP_BASE_NAME=%~n0
1430
set APP_HOME=%DIRNAME%
1531

1632
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
17-
set DEFAULT_JVM_OPTS="-Xmx64m"
33+
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
1834

1935
@rem Find java.exe
2036
if defined JAVA_HOME goto findJavaFromJavaHome

spring-kafka/src/main/java/org/springframework/kafka/annotation/KafkaBootstrapConfiguration.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,19 +33,19 @@
3333
*
3434
* @author Stephane Nicoll
3535
* @author Gary Russell
36+
* @author Artem Bilan
3637
*
3738
* @see KafkaListenerAnnotationBeanPostProcessor
3839
* @see KafkaListenerEndpointRegistry
3940
* @see EnableKafka
4041
*/
41-
@Configuration
42+
@Configuration(proxyBeanMethods = false)
4243
public class KafkaBootstrapConfiguration {
4344

44-
@SuppressWarnings("rawtypes")
4545
@Bean(name = KafkaListenerConfigUtils.KAFKA_LISTENER_ANNOTATION_PROCESSOR_BEAN_NAME)
4646
@Role(BeanDefinition.ROLE_INFRASTRUCTURE)
47-
public KafkaListenerAnnotationBeanPostProcessor kafkaListenerAnnotationProcessor() {
48-
return new KafkaListenerAnnotationBeanPostProcessor();
47+
public KafkaListenerAnnotationBeanPostProcessor<?, ?> kafkaListenerAnnotationProcessor() {
48+
return new KafkaListenerAnnotationBeanPostProcessor<>();
4949
}
5050

5151
@Bean(name = KafkaListenerConfigUtils.KAFKA_LISTENER_ENDPOINT_REGISTRY_BEAN_NAME)

spring-kafka/src/main/java/org/springframework/kafka/annotation/KafkaStreamsDefaultConfiguration.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
*
4040
* @since 1.1.4
4141
*/
42-
@Configuration
42+
@Configuration(proxyBeanMethods = false)
4343
public class KafkaStreamsDefaultConfiguration {
4444

4545
/**
@@ -56,8 +56,8 @@ public class KafkaStreamsDefaultConfiguration {
5656
@Bean(name = DEFAULT_STREAMS_BUILDER_BEAN_NAME)
5757
public StreamsBuilderFactoryBean defaultKafkaStreamsBuilder(
5858
@Qualifier(DEFAULT_STREAMS_CONFIG_BEAN_NAME)
59-
ObjectProvider<KafkaStreamsConfiguration> streamsConfigProvider,
60-
ObjectProvider<StreamsBuilderFactoryBeanCustomizer> customizerProvider) {
59+
ObjectProvider<KafkaStreamsConfiguration> streamsConfigProvider,
60+
ObjectProvider<StreamsBuilderFactoryBeanCustomizer> customizerProvider) {
6161

6262
KafkaStreamsConfiguration streamsConfig = streamsConfigProvider.getIfAvailable();
6363
if (streamsConfig != null) {

0 commit comments

Comments
 (0)