Upgrades and doc fixes

* Upgrade Gradle to 5.2.1, assertj - 3.12.0, SonarQube - 2.7,
asciidoctor - 1.5.10
* Fix docs for proper version rendering
* Move "What's New" to the `changes-since-1.0.adoc` and news for
current `2.3`
This commit is contained in:
Artem Bilan
2019-02-15 15:44:47 -05:00
parent 1721d9ea93
commit acdc268620
9 changed files with 216 additions and 197 deletions

View File

@@ -11,11 +11,11 @@ buildscript {
}
plugins {
id 'org.sonarqube' version '2.6.2'
id 'base'
id 'project-report'
id 'idea'
id 'org.asciidoctor.convert' version '1.5.9.2'
id "org.sonarqube" version '2.7'
id 'org.asciidoctor.convert' version '1.5.10'
id 'org.ajoberstar.grgit' version '3.0.0'
}
@@ -69,7 +69,7 @@ subprojects { subproject ->
}
ext {
assertjVersion = '3.11.1'
assertjVersion = '3.12.0'
googleJsr305Version = '3.0.2'
hamcrestVersion = '1.3'
hibernateValidationVersion = '6.0.14.Final'
@@ -93,7 +93,7 @@ subprojects { subproject ->
eclipse.project.natures += 'org.springframework.ide.eclipse.core.springnature'
jacoco {
toolVersion = '0.8.1'
toolVersion = '0.8.2'
}
// dependencies that are common across all java projects
@@ -174,7 +174,7 @@ subprojects { subproject ->
}
}
processResources.dependsOn updateCopyrights
compileKotlin.dependsOn updateCopyrights
task sourcesJar(type: Jar) {
classifier = 'sources'
@@ -362,12 +362,12 @@ task docsZip(type: Zip, dependsOn: [reference]) {
}
from ('build/asciidoc/html5') {
into 'reference'
into 'reference/html'
}
from ('build/asciidoc/pdf') {
include 'index.pdf'
into 'reference'
into 'reference/pdf'
}
}

Binary file not shown.

View File

@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-5.2.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

2
gradlew vendored
View File

@@ -28,7 +28,7 @@ APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""
DEFAULT_JVM_OPTS='"-Xmx64m"'
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"

168
gradlew.bat vendored
View File

@@ -1,84 +1,84 @@
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto init
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:init
@rem Get command-line arguments, handling Windows variants
if not "%OS%" == "Windows_NT" goto win9xME_args
:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2
:win9xME_args_slurp
if "x%~1" == "x" goto execute
set CMD_LINE_ARGS=%*
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS="-Xmx64m"
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto init
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:init
@rem Get command-line arguments, handling Windows variants
if not "%OS%" == "Windows_NT" goto win9xME_args
:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2
:win9xME_args_slurp
if "x%~1" == "x" goto execute
set CMD_LINE_ARGS=%*
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega

View File

@@ -1,6 +1,118 @@
[[migration]]
=== Changes between 2.1 and 2.2
[[kafka-client-2.0]]
==== Kafka Client Version
This version requires the 2.0.0 `kafka-clients` or higher.
==== Class and Package Changes
The `ContainerProperties` class has been moved from `org.springframework.kafka.listener.config` to `org.springframework.kafka.listener`.
The `AckMode` enum has been moved from `AbstractMessageListenerContainer` to `ContainerProperties`.
The `setBatchErrorHandler()` and `setErrorHandler()` methods have been moved from `ContainerProperties` to both `AbstractMessageListenerContainer` and `AbstractKafkaListenerContainerFactory`.
==== After Rollback Processing
A new `AfterRollbackProcessor` strategy is provided.
See <<after-rollback>> for more information.
==== `ConcurrentKafkaListenerContainerFactory` Changes
You can now use the `ConcurrentKafkaListenerContainerFactory` to create and configure any `ConcurrentMessageListenerContainer`, not only those for `@KafkaListener` annotations.
See <<container-factory>> for more information.
==== Listener Container Changes
A new container property (`missingTopicsFatal`) has been added.
See <<kafka-container>> for more information.
A `ConsumerStoppedEvent` is now emitted when a consumer terminates.
See <<thread-safety>> for more information.
Batch listeners can optionally receive the complete `ConsumerRecords<?, ?>` object instead of a `List<ConsumerRecord<?, ?>`.
See <<batch-listeners>> for more information.
The `DefaultAfterRollbackProcessor` and `SeekToCurrentErrorHandler` can now recover (skip) records that keep failing, and, by default, does so after 10 failures.
They can be configured to publish failed records to a dead-letter topic.
Starting with version 2.2.4, the consumer's group ID can be used while selecting the dead letter topic name.
See <<after-rollback>>, <<seek-to-current>>, and <<dead-letters>> for more information.
The `ConsumerStoppingEvent` has been added.
See <<events>> for more information.
The `SeekToCurrentErrorHandler` can now be configured to commit the offset of a recovered record when the container is configured with `AckMode.MANUAL_IMMEDIATE` (since 2.2.4).
See <<seek-to-current>> for more information.
==== @KafkaListener Changes
You can now override the `concurrency` and `autoStartup` properties of the listener container factory by setting properties on the annotation.
You can now add configuration to determine which headers (if any) are copied to a reply message.
See <<kafka-listener-annotation>> for more information.
You can now use `@KafkaListener` as a meta-annotation on your own annotations.
See <<kafka-listener-meta>> for more information.
It is now easier to configure a `Validator` for `@Payload` validation.
See <<kafka-validation>> for more information.
You can now specify kafka consumer properties directly on the annotation; these will override any properties with the same name defined in the consumer factory (since version 2.2.4).
See <<annotation-properties>> for more information.
==== Header Mapping Changes
Headers of type `MimeType` and `MediaType` are now mapped as simple strings in the `RecordHeader` value.
Previously, they were mapped as JSON and only `MimeType` was decoded.
`MediaType` could not be decoded.
They are now simple strings for interoperability.
Also, the `DefaultKafkaHeaderMapper` has a new `addToStringClasses` method, allowing the specification of types that should be mapped by using `toString()` instead of JSON.
See <<headers>> for more information.
==== Embedded Kafka Changes
The `KafkaEmbedded` class and its `KafkaRule` interface have been deprecated in favor of the `EmbeddedKafkaBroker` and its JUnit 4 `EmbeddedKafkaRule` wrapper.
The `@EmbeddedKafka` annotation now populates an `EmbeddedKafkaBroker` bean instead of the deprecated `KafkaEmbedded`.
This change allows the use of `@EmbeddedKafka` in JUnit 5 tests.
The `@EmbeddedKafka` annotation now has the attribute `ports` to specify the port that populates the `EmbeddedKafkaBroker`.
See <<testing>> for more information.
==== JsonSerializer/Deserializer Enhancements
You can now provide type mapping information by using producer and consumer properties.
New constructors are available on the deserializer to allow overriding the type header information with the supplied target type.
The `JsonDeserializer` now removes any type information headers by default.
You can now configure the `JsonDeserializer` to ignore type information headers by using a Kafka property (since 2.2.3).
See <<serdes>> for more information.
==== Kafka Streams Changes
The streams configuration bean must now be a `KafkaStreamsConfiguration` object instead of a `StreamsConfig` object.
The `StreamsBuilderFactoryBean` has been moved from package `...core` to `...config`.
The `KafkaStreamBrancher` has been introduced for better end-user experience when conditional branches are built on top of `KStream` instance.
See <<kafka-streams>> and <<streams-config>> for more information.
==== Transactional ID
When a transaction is started by the listener container, the `transactional.id` is now the `transactionIdPrefix` appended with `<group.id>.<topic>.<partition>`.
This change allows proper fencing of zombies, https://www.confluent.io/blog/transactions-apache-kafka/[as described here].
=== Changes between 2.0 and 2.1
[[kafka-client-1.0]]
==== Kafka Client Version
This version requires the 1.0.0 `kafka-clients` or higher.

View File

@@ -0,0 +1,5 @@
<style>
#header #revnumber {
display: none
}
</style>

View File

@@ -7,7 +7,9 @@
:hide-uri-scheme:
Gary Russell; Artem Bilan; Biju Kunjummen; Jay Bryant
ifdef::backend-html5[]
*{project-version}*
endif::[]
(C) 2016 - 2019 by Pivotal Software, Inc.

View File

@@ -1,110 +1,10 @@
=== What's New in 2.2 Since 2.1
=== What's New in 2.3 Since 2.2
This section covers the changes made from version 2.1 to version 2.2.
This section covers the changes made from version 2.2 to version 2.3.
[[kafka-client-2.1]]
==== Kafka Client Version
This version requires the 2.0.0 `kafka-clients` or higher.
==== Class and Package Changes
The `ContainerProperties` class has been moved from `org.springframework.kafka.listener.config` to `org.springframework.kafka.listener`.
The `AckMode` enum has been moved from `AbstractMessageListenerContainer` to `ContainerProperties`.
The `setBatchErrorHandler()` and `setErrorHandler()` methods have been moved from `ContainerProperties` to both `AbstractMessageListenerContainer` and `AbstractKafkaListenerContainerFactory`.
==== After Rollback Processing
A new `AfterRollbackProcessor` strategy is provided.
See <<after-rollback>> for more information.
==== `ConcurrentKafkaListenerContainerFactory` Changes
You can now use the `ConcurrentKafkaListenerContainerFactory` to create and configure any `ConcurrentMessageListenerContainer`, not only those for `@KafkaListener` annotations.
See <<container-factory>> for more information.
==== Listener Container Changes
A new container property (`missingTopicsFatal`) has been added.
See <<kafka-container>> for more information.
A `ConsumerStoppedEvent` is now emitted when a consumer terminates.
See <<thread-safety>> for more information.
Batch listeners can optionally receive the complete `ConsumerRecords<?, ?>` object instead of a `List<ConsumerRecord<?, ?>`.
See <<batch-listeners>> for more information.
The `DefaultAfterRollbackProcessor` and `SeekToCurrentErrorHandler` can now recover (skip) records that keep failing, and, by default, does so after 10 failures.
They can be configured to publish failed records to a dead-letter topic.
Starting with version 2.2.4, the consumer's group ID can be used while selecting the dead letter topic name.
See <<after-rollback>>, <<seek-to-current>>, and <<dead-letters>> for more information.
The `ConsumerStoppingEvent` has been added.
See <<events>> for more information.
The `SeekToCurrentErrorHandler` can now be configured to commit the offset of a recovered record when the container is configured with `AckMode.MANUAL_IMMEDIATE` (since 2.2.4).
See <<seek-to-current>> for more information.
==== @KafkaListener Changes
You can now override the `concurrency` and `autoStartup` properties of the listener container factory by setting properties on the annotation.
You can now add configuration to determine which headers (if any) are copied to a reply message.
See <<kafka-listener-annotation>> for more information.
You can now use `@KafkaListener` as a meta-annotation on your own annotations.
See <<kafka-listener-meta>> for more information.
It is now easier to configure a `Validator` for `@Payload` validation.
See <<kafka-validation>> for more information.
You can now specify kafka consumer properties directly on the annotation; these will override any properties with the same name defined in the consumer factory (since version 2.2.4).
See <<annotation-properties>> for more information.
==== Header Mapping Changes
Headers of type `MimeType` and `MediaType` are now mapped as simple strings in the `RecordHeader` value.
Previously, they were mapped as JSON and only `MimeType` was decoded.
`MediaType` could not be decoded.
They are now simple strings for interoperability.
Also, the `DefaultKafkaHeaderMapper` has a new `addToStringClasses` method, allowing the specification of types that should be mapped by using `toString()` instead of JSON.
See <<headers>> for more information.
==== Embedded Kafka Changes
The `KafkaEmbedded` class and its `KafkaRule` interface have been deprecated in favor of the `EmbeddedKafkaBroker` and its JUnit 4 `EmbeddedKafkaRule` wrapper.
The `@EmbeddedKafka` annotation now populates an `EmbeddedKafkaBroker` bean instead of the deprecated `KafkaEmbedded`.
This change allows the use of `@EmbeddedKafka` in JUnit 5 tests.
The `@EmbeddedKafka` annotation now has the attribute `ports` to specify the port that populates the `EmbeddedKafkaBroker`.
See <<testing>> for more information.
==== JsonSerializer/Deserializer Enhancements
You can now provide type mapping information by using producer and consumer properties.
New constructors are available on the deserializer to allow overriding the type header information with the supplied target type.
The `JsonDeserializer` now removes any type information headers by default.
You can now configure the `JsonDeserializer` to ignore type information headers by using a Kafka property (since 2.2.3).
See <<serdes>> for more information.
==== Kafka Streams Changes
The streams configuration bean must now be a `KafkaStreamsConfiguration` object instead of a `StreamsConfig` object.
The `StreamsBuilderFactoryBean` has been moved from package `...core` to `...config`.
The `KafkaStreamBrancher` has been introduced for better end-user experience when conditional branches are built on top of `KStream` instance.
See <<kafka-streams>> and <<streams-config>> for more information.
This version requires the 2.1.0 `kafka-clients` or higher.
==== Transactional ID
When a transaction is started by the listener container, the `transactional.id` is now the `transactionIdPrefix` appended with `<group.id>.<topic>.<partition>`.
This change allows proper fencing of zombies, https://www.confluent.io/blog/transactions-apache-kafka/[as described here].