diff --git a/.editorconfig b/.editorconfig
deleted file mode 100644
index 657e65a22..000000000
--- a/.editorconfig
+++ /dev/null
@@ -1,18 +0,0 @@
-# EditorConfig is awesome: http://EditorConfig.org
-
-# top-most EditorConfig file
-root = true
-
-[*]
-indent_style = tab
-indent_size = 4
-end_of_line = lf
-insert_final_newline = true
-
-[*.yml]
-indent_style = space
-indent_size = 2
-
-[*.java]
-ij_java_names_count_to_use_import_on_demand = 999
-ij_java_class_count_to_use_import_on_demand = 999
diff --git a/.github/ISSUE_TEMPLATE/new-issue.md b/.github/ISSUE_TEMPLATE/new-issue.md
deleted file mode 100644
index a67364d11..000000000
--- a/.github/ISSUE_TEMPLATE/new-issue.md
+++ /dev/null
@@ -1,37 +0,0 @@
----
-name: New Issue
-about: Create a report to help us improve
-title: ''
-labels: ''
-assignees: ''
-
----
-
-Thanks for considering raising a Spring Cloud Stream issue. Please take the time to review the following categories as some of them do not apply here.
-
-π "Please DO NOT Raise an Issue" Cases
-- Question
-STOP!! Please ask questions about how to use something, or to understand why something isn't working as you expect it to, on Stack Overflow using the spring-cloud-stream tag.
-- Security Vulnerability
-STOP!! Please don't raise security vulnerabilities here. Head over to https://pivotal.io/security to learn how to disclose them responsibly.
-- With an Immediate Pull Request
-An issue will be closed as a duplicate of the immediate pull request, so you don't have to raise an issue if you plan to create a pull request immediately.
-
-If your case does not match any of he above categories. . .
-
-**Describe the issue**
-A clear and concise description of what the bug is.
-
-**To Reproduce**
-Steps to reproduce the behavior:
-1. Go to '...'
-2. Click on '....'
-3. Scroll down to '....'
-4. See error
-
-**Version of the framework**
-**Expected behavior**
-**Screenshots**
-
-**Additional context**
-Add any other context about the problem here.
diff --git a/.github/workflows/deploy-docs.yml b/.github/workflows/deploy-docs.yml
new file mode 100644
index 000000000..6921fd132
--- /dev/null
+++ b/.github/workflows/deploy-docs.yml
@@ -0,0 +1,53 @@
+name: Deploy Docs
+run-name: ${{ format('{0} ({1})', github.workflow, github.event.inputs.build-refname || 'all') }}
+on:
+ workflow_dispatch:
+ inputs:
+ build-refname:
+ description: Enter git refname to build (e.g., 5.7.x).
+ required: false
+ push:
+ branches: docs-build
+env:
+ GRADLE_ENTERPRISE_SECRET_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_SECRET_ACCESS_KEY }}
+permissions:
+ contents: write
+jobs:
+ build:
+ if: github.repository_owner == 'spring-cloud'
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v3
+ with:
+ fetch-depth: 5
+ - name: Set up JDK 17
+ uses: actions/setup-java@v3
+ with:
+ java-version: '17'
+ distribution: 'temurin'
+ - name: Set up refname build
+ if: github.event.inputs.build-refname
+ run: |
+ git fetch --depth 1 https://github.com/$GITHUB_REPOSITORY ${{ github.event.inputs.build-refname }}
+ export BUILD_REFNAME=${{ github.event.inputs.build-refname }}
+ echo "BUILD_REFNAME=$BUILD_REFNAME" >> $GITHUB_ENV
+ export BUILD_VERSION=$(git cat-file --textconv FETCH_HEAD:pom.xml | python3 -c "import xml.etree.ElementTree as xml; from sys import stdin; print(xml.parse(stdin).getroot().find('{http://maven.apache.org/POM/4.0.0}version').text)")
+ echo BUILD_VERSION=$BUILD_VERSION >> $GITHUB_ENV
+ - name: Run Antora
+ run: |
+ ./mvnw --no-transfer-progress -B antora
+ - name: Publish Docs
+ uses: rwinch/spring-doc-actions/rsync-antora-reference@httpdocs-path
+ with:
+ docs-username: ${{ secrets.DOCS_USERNAME }}
+ docs-host: ${{ secrets.DOCS_HOST }}
+ docs-ssh-key: ${{ secrets.DOCS_SSH_KEY }}
+ docs-ssh-host-key: ${{ secrets.DOCS_SSH_HOST_KEY }}
+ site-path: target/antora/site
+ - name: Bust Cloudflare Cache
+ uses: spring-io/spring-doc-actions/bust-cloudflare-antora-cache@v0.0.11
+ with:
+ context-root: spring-cloud-stream
+ cloudflare-zone-id: ${{ secrets.CLOUDFLARE_ZONE_ID }}
+ cloudflare-cache-token: ${{ secrets.CLOUDFLARE_CACHE_TOKEN }}
diff --git a/.gitignore b/.gitignore
index 214f0bcb3..6be8a4a16 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,27 +1,22 @@
-/application.yml
-/application.properties
-asciidoctor.css
-*~
-.#*
-*#
target/
-build/
-bin/
-_site/
-.classpath
+.settings/
.project
-.settings
+.classpath
+*.orig
.springBeans
-.sts4-cache/
-.attach_pid*
+.factorypath
+.sts4-cache
+.ant-targets-build.xml
+src/ant/.ant-targets-upload-dist.xml
+*.sonar4clipse*
.DS_Store
-*.sw*
*.iml
*.ipr
*.iws
-.idea/*
-.factorypath
-dump.rdb
-.apt_generated
-artifacts
-**/dependency-reduced-pom.xml
+/.idea/
+*.graphml
+node
+node_modules
+build
+package.json
+package-lock.json
diff --git a/.jdk8 b/.jdk8
deleted file mode 100644
index e69de29bb..000000000
diff --git a/.mvn/maven.config b/.mvn/maven.config
deleted file mode 100644
index 3b8cf46e1..000000000
--- a/.mvn/maven.config
+++ /dev/null
@@ -1 +0,0 @@
--DaltSnapshotDeploymentRepository=repo.spring.io::default::https://repo.spring.io/libs-snapshot-local -P spring
diff --git a/.settings.xml b/.settings.xml
deleted file mode 100644
index 03645e8ce..000000000
--- a/.settings.xml
+++ /dev/null
@@ -1,68 +0,0 @@
-
-
-
-
- repo.spring.io
- ${env.CI_DEPLOY_USERNAME}
- ${env.CI_DEPLOY_PASSWORD}
-
-
-
-
-
- spring
-
- true
-
-
-
- spring-snapshots
- Spring Snapshots
- https://repo.spring.io/libs-snapshot-local
-
- true
-
-
-
- spring-milestones
- Spring Milestones
- https://repo.spring.io/libs-milestone-local
-
- false
-
-
-
- spring-releases
- Spring Releases
- https://repo.spring.io/release
-
- false
-
-
-
-
-
- spring-snapshots
- Spring Snapshots
- https://repo.spring.io/libs-snapshot-local
-
- true
-
-
-
- spring-milestones
- Spring Milestones
- https://repo.spring.io/libs-milestone-local
-
- false
-
-
-
-
-
-
diff --git a/.springformat b/.springformat
deleted file mode 100644
index e69de29bb..000000000
diff --git a/.travis.yml b/.travis.yml
deleted file mode 100644
index e63f59f85..000000000
--- a/.travis.yml
+++ /dev/null
@@ -1,17 +0,0 @@
-sudo: required
-cache:
- directories:
- - $HOME/.m2
-language: java
-jdk:
- - oraclejdk8
-install: true
-# The environment variable ${TRAVIS_PULL_REQUEST} is set to "false" when the build
-# is for a normal branch commit. When the build is for a pull request, it will
-# contain the pull requestβs number.
-script:
- - '[ "${TRAVIS_PULL_REQUEST}" != "false" ] || ./mvnw package -Pspring,full -U -Dmaven.test.redirectTestOutputToFile=false'
- - '[ "${TRAVIS_PULL_REQUEST}" = "false" ] || ./mvnw package -Pspring -U -Dmaven.test.redirectTestOutputToFile=false'
-after_success:
- - bash <(curl -s https://codecov.io/bash)
-dist: trusty
diff --git a/CODE_OF_CONDUCT.adoc b/CODE_OF_CONDUCT.adoc
deleted file mode 100644
index f013d6f36..000000000
--- a/CODE_OF_CONDUCT.adoc
+++ /dev/null
@@ -1,44 +0,0 @@
-= Contributor Code of Conduct
-
-As contributors and maintainers of this project, and in the interest of fostering an open
-and welcoming community, we pledge to respect all people who contribute through reporting
-issues, posting feature requests, updating documentation, submitting pull requests or
-patches, and other activities.
-
-We are committed to making participation in this project a harassment-free experience for
-everyone, regardless of level of experience, gender, gender identity and expression,
-sexual orientation, disability, personal appearance, body size, race, ethnicity, age,
-religion, or nationality.
-
-Examples of unacceptable behavior by participants include:
-
-* The use of sexualized language or imagery
-* Personal attacks
-* Trolling or insulting/derogatory comments
-* Public or private harassment
-* Publishing other's private information, such as physical or electronic addresses,
- without explicit permission
-* Other unethical or unprofessional conduct
-
-Project maintainers have the right and responsibility to remove, edit, or reject comments,
-commits, code, wiki edits, issues, and other contributions that are not aligned to this
-Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors
-that they deem inappropriate, threatening, offensive, or harmful.
-
-By adopting this Code of Conduct, project maintainers commit themselves to fairly and
-consistently applying these principles to every aspect of managing this project. Project
-maintainers who do not follow or enforce the Code of Conduct may be permanently removed
-from the project team.
-
-This Code of Conduct applies both within project spaces and in public spaces when an
-individual is representing the project or its community.
-
-Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by
-contacting a project maintainer at spring-code-of-conduct@pivotal.io . All complaints will
-be reviewed and investigated and will result in a response that is deemed necessary and
-appropriate to the circumstances. Maintainers are obligated to maintain confidentiality
-with regard to the reporter of an incident.
-
-This Code of Conduct is adapted from the
-http://contributor-covenant.org[Contributor Covenant], version 1.3.0, available at
-http://contributor-covenant.org/version/1/3/0/[contributor-covenant.org/version/1/3/0/]
diff --git a/LICENSE b/LICENSE
deleted file mode 100644
index 8f71f43fe..000000000
--- a/LICENSE
+++ /dev/null
@@ -1,202 +0,0 @@
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "{}"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright {yyyy} {name of copyright owner}
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
diff --git a/README.adoc b/README.adoc
index 0ab25fa7c..4ff7a2d99 100644
--- a/README.adoc
+++ b/README.adoc
@@ -1,409 +1,23 @@
-////
-DO NOT EDIT THIS FILE. IT WAS GENERATED.
-Manual changes to this file will be lost when it is generated again.
-Edit the files in the src/main/asciidoc/ directory instead.
-////
+= Spring Cloud Stream Docs Build
+You're currently viewing the Antora playbook branch.
+The playbook branch hosts the docs build that is used to build and publish the production docs site.
-:jdkversion: 17
-:github-tag: master
-:github-repo: spring-cloud/spring-cloud-stream
+The Spring Cloud Stream reference docs are built using https://antora.org[Antora].
+This README covers how to build the docs in a software branch as well as how to build the production docs site locally.
-:github-raw: https://raw.githubusercontent.com/{github-repo}/{github-tag}
-:github-code: https://github.com/{github-repo}/tree/{github-tag}
+== Building the Site
-image::https://circleci.com/gh/spring-cloud/spring-cloud-stream.svg?style=svg["CircleCI", link="https://circleci.com/gh/spring-cloud/spring-cloud-stream"]
-image::https://codecov.io/gh/spring-cloud/spring-cloud-stream/branch/{github-tag}/graph/badge.svg["codecov", link="https://codecov.io/gh/spring-cloud/spring-cloud-stream"]
-image::https://badges.gitter.im/spring-cloud/spring-cloud-stream.svg[Gitter, link="https://gitter.im/spring-cloud/spring-cloud-stream?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge"]
+You can build the entire site by invoking the following on the docs-build branch and then viewing the site at `target/site/index.html`
-// ======================================================================================
-
-== Introduction
-Spring Cloud Stream is a framework for building message-driven microservice applications.
-Spring Cloud Stream builds upon Spring Boot to create standalone, production-grade Spring applications and uses Spring Integration to provide connectivity to message brokers.
-It provides opinionated configuration of middleware from several vendors, introducing the concepts of persistent publish-subscribe semantics, consumer groups, and partitions.
-These are called binder implementations in the parlance of Spring Cloud Stream.
-Out of the box, Spring Cloud Stream provides binder implementations for Apache Kafka and RabbitMQ.
-While these two binder implementations are based on Message Channels, Spring Cloud Stream also provides another binder implementation for Kafka Streams that does not use message channels, but native Kafka Streams types such as KStream, KTable etc.
-
-Below, you can find more information on how to use these various out-of-the-box binder implementations in your applications.
-
-== Apache Kafka Binder
-
-=== Usage
-
-To use Apache Kafka binder, you need to add `spring-cloud-stream-binder-kafka` as a dependency to your Spring Cloud Stream application, as shown in the following example for Maven:
-
-[source,xml]
+[source,bash]
----
-
- org.springframework.cloud
- spring-cloud-stream-binder-kafka
-
+./mvnw antora
----
-Alternatively, you can also use the Spring Cloud Stream Kafka Starter, as shown in the following example for Maven:
+== Building a Specific Branch
-[source,xml]
+[source,bash]
----
-
- org.springframework.cloud
- spring-cloud-starter-stream-kafka
-
+./mvnw antora
----
-
-== Apache Kafka Streams Binder
-
-=== Usage
-
-To use Apache Kafka Streams binder, you need to add `spring-cloud-stream-binder-kafka-streams` as a dependency to your Spring Cloud Stream application, as shown in the following example for Maven:
-
-[source,xml]
-----
-
- org.springframework.cloud
- spring-cloud-stream-binder-kafka-streams
-
-----
-
-== RabbitMQ Binder
-=== Usage
-
-To use the RabbitMQ binder, you can add it to your Spring Cloud Stream application, by using the following Maven coordinates:
-
-[source,xml]
-----
-
- org.springframework.cloud
- spring-cloud-stream-binder-rabbit
-
-----
-
-Alternatively, you can use the Spring Cloud Stream RabbitMQ Starter, as follows:
-
-[source,xml]
-----
-
- org.springframework.cloud
- spring-cloud-starter-stream-rabbit
-
-----
-
-== Resources
-
-For more information, please visit the https://spring.io/projects/spring-cloud-stream[project website]:
-
-== Building
-
-:jdkversion: 17
-
-=== Basic Compile and Test
-
-To build the source you will need to install JDK {jdkversion}.
-
-Spring Cloud uses Maven for most build-related activities, and you
-should be able to get off the ground quite quickly by cloning the
-project you are interested in and typing
-
-----
-$ ./mvnw install
-----
-
-NOTE: You can also install Maven (>=3.3.3) yourself and run the `mvn` command
-in place of `./mvnw` in the examples below. If you do that you also
-might need to add `-P spring` if your local Maven settings do not
-contain repository declarations for spring pre-release artifacts.
-
-NOTE: Be aware that you might need to increase the amount of memory
-available to Maven by setting a `MAVEN_OPTS` environment variable with
-a value like `-Xmx512m -XX:MaxPermSize=128m`. We try to cover this in
-the `.mvn` configuration, so if you find you have to do it to make a
-build succeed, please raise a ticket to get the settings added to
-source control.
-
-The projects that require middleware (i.e. Redis) for testing generally
-require that a local instance of [Docker](https://www.docker.com/get-started) is installed and running.
-
-
-=== Documentation
-
-The spring-cloud-build module has a "docs" profile, and if you switch
-that on it will try to build asciidoc sources from
-`src/main/asciidoc`. As part of that process it will look for a
-`README.adoc` and process it by loading all the includes, but not
-parsing or rendering it, just copying it to `${main.basedir}`
-(defaults to `${basedir}`, i.e. the root of the project). If there are
-any changes in the README it will then show up after a Maven build as
-a modified file in the correct place. Just commit it and push the change.
-
-=== Working with the code
-If you don't have an IDE preference we would recommend that you use
-https://www.springsource.com/developer/sts[Spring Tools Suite] or
-https://eclipse.org[Eclipse] when working with the code. We use the
-https://eclipse.org/m2e/[m2eclipse] eclipse plugin for maven support. Other IDEs and tools
-should also work without issue as long as they use Maven 3.3.3 or better.
-
-==== Activate the Spring Maven profile
-Spring Cloud projects require the 'spring' Maven profile to be activated to resolve
-the spring milestone and snapshot repositories. Use your preferred IDE to set this
-profile to be active, or you may experience build errors.
-
-==== Importing into eclipse with m2eclipse
-We recommend the https://eclipse.org/m2e/[m2eclipse] eclipse plugin when working with
-eclipse. If you don't already have m2eclipse installed it is available from the "eclipse
-marketplace".
-
-NOTE: Older versions of m2e do not support Maven 3.3, so once the
-projects are imported into Eclipse you will also need to tell
-m2eclipse to use the right profile for the projects. If you
-see many different errors related to the POMs in the projects, check
-that you have an up to date installation. If you can't upgrade m2e,
-add the "spring" profile to your `settings.xml`. Alternatively you can
-copy the repository settings from the "spring" profile of the parent
-pom into your `settings.xml`.
-
-==== Importing into eclipse without m2eclipse
-If you prefer not to use m2eclipse you can generate eclipse project metadata using the
-following command:
-
-[indent=0]
-----
- $ ./mvnw eclipse:eclipse
-----
-
-The generated eclipse projects can be imported by selecting `import existing projects`
-from the `file` menu.
-
-
-== Contributing
-
-:spring-cloud-build-branch: master
-
-Spring Cloud is released under the non-restrictive Apache 2.0 license,
-and follows a very standard Github development process, using Github
-tracker for issues and merging pull requests into master. If you want
-to contribute even something trivial please do not hesitate, but
-follow the guidelines below.
-
-=== Sign the Contributor License Agreement
-Before we accept a non-trivial patch or pull request we will need you to sign the
-https://cla.pivotal.io/sign/spring[Contributor License Agreement].
-Signing the contributor's agreement does not grant anyone commit rights to the main
-repository, but it does mean that we can accept your contributions, and you will get an
-author credit if we do. Active contributors might be asked to join the core team, and
-given the ability to merge pull requests.
-
-=== Code of Conduct
-This project adheres to the Contributor Covenant https://github.com/spring-cloud/spring-cloud-build/blob/master/docs/src/main/asciidoc/code-of-conduct.adoc[code of
-conduct]. By participating, you are expected to uphold this code. Please report
-unacceptable behavior to spring-code-of-conduct@pivotal.io.
-
-=== Code Conventions and Housekeeping
-None of these is essential for a pull request, but they will all help. They can also be
-added after the original pull request but before a merge.
-
-* Use the Spring Framework code format conventions. If you use Eclipse
- you can import formatter settings using the
- `eclipse-code-formatter.xml` file from the
- https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/spring-cloud-dependencies-parent/eclipse-code-formatter.xml[Spring
- Cloud Build] project. If using IntelliJ, you can use the
- https://plugins.jetbrains.com/plugin/6546[Eclipse Code Formatter
- Plugin] to import the same file.
-* Make sure all new `.java` files to have a simple Javadoc class comment with at least an
- `@author` tag identifying you, and preferably at least a paragraph on what the class is
- for.
-* Add the ASF license header comment to all new `.java` files (copy from existing files
- in the project)
-* Add yourself as an `@author` to the .java files that you modify substantially (more
- than cosmetic changes).
-* Add some Javadocs and, if you change the namespace, some XSD doc elements.
-* A few unit tests would help a lot as well -- someone has to do it.
-* If no-one else is using your branch, please rebase it against the current master (or
- other target branch in the main project).
-* When writing a commit message please follow https://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html[these conventions],
- if you are fixing an existing issue please add `Fixes gh-XXXX` at the end of the commit
- message (where XXXX is the issue number).
-
-=== Checkstyle
-
-Spring Cloud Build comes with a set of checkstyle rules. You can find them in the `spring-cloud-build-tools` module. The most notable files under the module are:
-
-.spring-cloud-build-tools/
-----
-βββ src
- Β Β βββ checkstyle
- Β Β βΒ Β βββ checkstyle-suppressions.xml <3>
- Β Β βββ main
- Β Β βββ resources
- Β Β βββ checkstyle-header.txt <2>
- Β Β βββ checkstyle.xml <1>
-----
-<1> Default Checkstyle rules
-<2> File header setup
-<3> Default suppression rules
-
-==== Checkstyle configuration
-
-Checkstyle rules are *disabled by default*. To add checkstyle to your project just define the following properties and plugins.
-
-.pom.xml
-----
-
-true <1>
- true
- <2>
- true
- <3>
-
-
-
-
- <4>
- io.spring.javaformat
- spring-javaformat-maven-plugin
-
- <5>
- org.apache.maven.plugins
- maven-checkstyle-plugin
-
-
-
-
-
- <5>
- org.apache.maven.plugins
- maven-checkstyle-plugin
-
-
-
-
-----
-<1> Fails the build upon Checkstyle errors
-<2> Fails the build upon Checkstyle violations
-<3> Checkstyle analyzes also the test sources
-<4> Add the Spring Java Format plugin that will reformat your code to pass most of the Checkstyle formatting rules
-<5> Add checkstyle plugin to your build and reporting phases
-
-If you need to suppress some rules (e.g. line length needs to be longer), then it's enough for you to define a file under `${project.root}/src/checkstyle/checkstyle-suppressions.xml` with your suppressions. Example:
-
-.projectRoot/src/checkstyle/checkstyle-suppresions.xml
-----
-
-
-
-
-
-
-----
-
-It's advisable to copy the `${spring-cloud-build.rootFolder}/.editorconfig` and `${spring-cloud-build.rootFolder}/.springformat` to your project. That way, some default formatting rules will be applied. You can do so by running this script:
-
-```bash
-$ curl https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/.editorconfig -o .editorconfig
-$ touch .springformat
-```
-
-=== IDE setup
-
-==== Intellij IDEA
-
-In order to setup Intellij you should import our coding conventions, inspection profiles and set up the checkstyle plugin.
-The following files can be found in the https://github.com/spring-cloud/spring-cloud-build/tree/master/spring-cloud-build-tools[Spring Cloud Build] project.
-
-.spring-cloud-build-tools/
-----
-βββ src
- Β Β βββ checkstyle
- Β Β βΒ Β βββ checkstyle-suppressions.xml <3>
- Β Β βββ main
- Β Β βββ resources
- Β Β βββ checkstyle-header.txt <2>
- Β Β βββ checkstyle.xml <1>
- Β Β βββ intellij
- Β Β Β Β βββ Intellij_Project_Defaults.xml <4>
- Β Β Β Β βββ Intellij_Spring_Boot_Java_Conventions.xml <5>
-----
-<1> Default Checkstyle rules
-<2> File header setup
-<3> Default suppression rules
-<4> Project defaults for Intellij that apply most of Checkstyle rules
-<5> Project style conventions for Intellij that apply most of Checkstyle rules
-
-.Code style
-
-image::https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/{spring-cloud-build-branch}/docs/src/main/asciidoc/images/intellij-code-style.png[Code style]
-
-Go to `File` -> `Settings` -> `Editor` -> `Code style`. There click on the icon next to the `Scheme` section. There, click on the `Import Scheme` value and pick the `Intellij IDEA code style XML` option. Import the `spring-cloud-build-tools/src/main/resources/intellij/Intellij_Spring_Boot_Java_Conventions.xml` file.
-
-.Inspection profiles
-
-image::https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/{spring-cloud-build-branch}/docs/src/main/asciidoc/images/intellij-inspections.png[Code style]
-
-Go to `File` -> `Settings` -> `Editor` -> `Inspections`. There click on the icon next to the `Profile` section. There, click on the `Import Profile` and import the `spring-cloud-build-tools/src/main/resources/intellij/Intellij_Project_Defaults.xml` file.
-
-.Checkstyle
-
-To have Intellij work with Checkstyle, you have to install the `Checkstyle` plugin. It's advisable to also install the `Assertions2Assertj` to automatically convert the JUnit assertions
-
-image::https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/{spring-cloud-build-branch}/docs/src/main/asciidoc/images/intellij-checkstyle.png[Checkstyle]
-
-Go to `File` -> `Settings` -> `Other settings` -> `Checkstyle`. There click on the `+` icon in the `Configuration file` section. There, you'll have to define where the checkstyle rules should be picked from. In the image above, we've picked the rules from the cloned Spring Cloud Build repository. However, you can point to the Spring Cloud Build's GitHub repository (e.g. for the `checkstyle.xml` : `https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/spring-cloud-build-tools/src/main/resources/checkstyle.xml`). We need to provide the following variables:
-
-- `checkstyle.header.file` - please point it to the Spring Cloud Build's, `spring-cloud-build-tools/src/main/resources/checkstyle-header.txt` file either in your cloned repo or via the `https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/spring-cloud-build-tools/src/main/resources/checkstyle-header.txt` URL.
-- `checkstyle.suppressions.file` - default suppressions. Please point it to the Spring Cloud Build's, `spring-cloud-build-tools/src/checkstyle/checkstyle-suppressions.xml` file either in your cloned repo or via the `https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/spring-cloud-build-tools/src/checkstyle/checkstyle-suppressions.xml` URL.
-- `checkstyle.additional.suppressions.file` - this variable corresponds to suppressions in your local project. E.g. you're working on `spring-cloud-contract`. Then point to the `project-root/src/checkstyle/checkstyle-suppressions.xml` folder. Example for `spring-cloud-contract` would be: `/home/username/spring-cloud-contract/src/checkstyle/checkstyle-suppressions.xml`.
-
-IMPORTANT: Remember to set the `Scan Scope` to `All sources` since we apply checkstyle rules for production and test sources.
-
-=== Duplicate Finder
-
-Spring Cloud Build brings along the `basepom:duplicate-finder-maven-plugin`, that enables flagging duplicate and conflicting classes and resources on the java classpath.
-
-==== Duplicate Finder configuration
-
-Duplicate finder is *enabled by default* and will run in the `verify` phase of your Maven build, but it will only take effect in your project if you add the `duplicate-finder-maven-plugin` to the `build` section of the projecst's `pom.xml`.
-
-.pom.xml
-[source,xml]
-----
-
-
-
- org.basepom.maven
- duplicate-finder-maven-plugin
-
-
-
-----
-
-For other properties, we have set defaults as listed in the https://github.com/basepom/duplicate-finder-maven-plugin/wiki[plugin documentation].
-
-You can easily override them but setting the value of the selected property prefixed with `duplicate-finder-maven-plugin`. For example, set `duplicate-finder-maven-plugin.skip` to `true` in order to skip duplicates check in your build.
-
-If you need to add `ignoredClassPatterns` or `ignoredResourcePatterns` to your setup, make sure to add them in the plugin configuration section of your project:
-
-[source,xml]
-----
-
-
-
- org.basepom.maven
- duplicate-finder-maven-plugin
-
-
- org.joda.time.base.BaseDateTime
- .*module-info
-
-
- changelog.txt
-
-
-
-
-
-
-
-----
-
diff --git a/docs/antora-playbook.yml b/antora-playbook.yml
similarity index 61%
rename from docs/antora-playbook.yml
rename to antora-playbook.yml
index 9a70e676c..49c71eedc 100644
--- a/docs/antora-playbook.yml
+++ b/antora-playbook.yml
@@ -6,38 +6,39 @@ antora:
- '@antora/collector-extension'
- '@antora/atlas-extension'
- require: '@springio/antora-extensions/root-component-extension'
- root_component_name: 'PROJECT_WITHOUT_SPRING'
- # FIXME: Run antora once using this extension to migrate to the Asciidoc Tabs syntax
- # and then remove this extension
- - require: '@springio/antora-extensions/tabs-migration-extension'
- unwrap_example_block: always
- save_result: true
+ root_component_name: 'cloud-stream'
site:
- title: PROJECT_FULL_NAME
- url: https://docs.spring.io/PROJECT_NAME/reference/
+ title: Spring Cloud Stream
+ url: https://docs.spring.io/spring-cloud-stream/reference
+ robots: allow
+git:
+ ensure_git_suffix: false
content:
sources:
- - url: ./..
- branches: HEAD
+ - url: https://github.com/spring-cloud/spring-cloud-stream
+ # Refname matching:
+ # https://docs.antora.org/antora/latest/playbook/content-refname-matching/
+ branches: [ main ]
+ tags: [ '({4..9}).+({1..9}).+({0..9})?(-{RC,M}+({0..9}))', '!4.1.0-M1' ]
start_path: docs
- worktrees: true
asciidoc:
attributes:
page-stackoverflow-url: https://stackoverflow.com/tags/spring-cloud
page-pagination: ''
hide-uri-scheme: '@'
tabs-sync-option: '@'
- chomp: 'all'
extensions:
- '@asciidoctor/tabs'
- '@springio/asciidoctor-extensions'
- sourcemap: true
urls:
+ latest_version_segment_strategy: redirect:to
latest_version_segment: ''
+ redirect_facility: httpd
+ui:
+ bundle:
+ url: https://github.com/spring-io/antora-ui-spring/releases/download/v0.3.5/ui-bundle.zip
+ snapshot: true
runtime:
log:
failure_level: warn
format: pretty
-ui:
- bundle:
- url: https://github.com/spring-io/antora-ui-spring/releases/download/v0.3.5/ui-bundle.zip
diff --git a/binders/kafka-binder/.gitignore b/binders/kafka-binder/.gitignore
deleted file mode 100644
index 8c6847291..000000000
--- a/binders/kafka-binder/.gitignore
+++ /dev/null
@@ -1,26 +0,0 @@
-/application.yml
-/application.properties
-asciidoctor.css
-*~
-.#*
-*#
-target/
-build/
-bin/
-_site/
-.classpath
-.project
-.settings
-.springBeans
-.DS_Store
-*.sw*
-*.iml
-*.ipr
-*.iws
-.idea/*
-*/.idea
-.factorypath
-dump.rdb
-.apt_generated
-artifacts
-.sts4-cache
diff --git a/binders/kafka-binder/.jdk8 b/binders/kafka-binder/.jdk8
deleted file mode 100644
index e69de29bb..000000000
diff --git a/binders/kafka-binder/.mvn/jvm.config b/binders/kafka-binder/.mvn/jvm.config
deleted file mode 100644
index 0e7dabeff..000000000
--- a/binders/kafka-binder/.mvn/jvm.config
+++ /dev/null
@@ -1 +0,0 @@
--Xmx1024m -XX:CICompilerCount=1 -XX:TieredStopAtLevel=1 -Djava.security.egd=file:/dev/./urandom
\ No newline at end of file
diff --git a/binders/kafka-binder/.mvn/maven.config b/binders/kafka-binder/.mvn/maven.config
deleted file mode 100644
index 3b8cf46e1..000000000
--- a/binders/kafka-binder/.mvn/maven.config
+++ /dev/null
@@ -1 +0,0 @@
--DaltSnapshotDeploymentRepository=repo.spring.io::default::https://repo.spring.io/libs-snapshot-local -P spring
diff --git a/binders/kafka-binder/.mvn/wrapper/MavenWrapperDownloader.java b/binders/kafka-binder/.mvn/wrapper/MavenWrapperDownloader.java
deleted file mode 100644
index b901097f2..000000000
--- a/binders/kafka-binder/.mvn/wrapper/MavenWrapperDownloader.java
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
- * Copyright 2007-present the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-import java.net.*;
-import java.io.*;
-import java.nio.channels.*;
-import java.util.Properties;
-
-public class MavenWrapperDownloader {
-
- private static final String WRAPPER_VERSION = "0.5.6";
- /**
- * Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided.
- */
- private static final String DEFAULT_DOWNLOAD_URL = "https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/"
- + WRAPPER_VERSION + "/maven-wrapper-" + WRAPPER_VERSION + ".jar";
-
- /**
- * Path to the maven-wrapper.properties file, which might contain a downloadUrl property to
- * use instead of the default one.
- */
- private static final String MAVEN_WRAPPER_PROPERTIES_PATH =
- ".mvn/wrapper/maven-wrapper.properties";
-
- /**
- * Path where the maven-wrapper.jar will be saved to.
- */
- private static final String MAVEN_WRAPPER_JAR_PATH =
- ".mvn/wrapper/maven-wrapper.jar";
-
- /**
- * Name of the property which should be used to override the default download url for the wrapper.
- */
- private static final String PROPERTY_NAME_WRAPPER_URL = "wrapperUrl";
-
- public static void main(String args[]) {
- System.out.println("- Downloader started");
- File baseDirectory = new File(args[0]);
- System.out.println("- Using base directory: " + baseDirectory.getAbsolutePath());
-
- // If the maven-wrapper.properties exists, read it and check if it contains a custom
- // wrapperUrl parameter.
- File mavenWrapperPropertyFile = new File(baseDirectory, MAVEN_WRAPPER_PROPERTIES_PATH);
- String url = DEFAULT_DOWNLOAD_URL;
- if(mavenWrapperPropertyFile.exists()) {
- FileInputStream mavenWrapperPropertyFileInputStream = null;
- try {
- mavenWrapperPropertyFileInputStream = new FileInputStream(mavenWrapperPropertyFile);
- Properties mavenWrapperProperties = new Properties();
- mavenWrapperProperties.load(mavenWrapperPropertyFileInputStream);
- url = mavenWrapperProperties.getProperty(PROPERTY_NAME_WRAPPER_URL, url);
- } catch (IOException e) {
- System.out.println("- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'");
- } finally {
- try {
- if(mavenWrapperPropertyFileInputStream != null) {
- mavenWrapperPropertyFileInputStream.close();
- }
- } catch (IOException e) {
- // Ignore ...
- }
- }
- }
- System.out.println("- Downloading from: " + url);
-
- File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH);
- if(!outputFile.getParentFile().exists()) {
- if(!outputFile.getParentFile().mkdirs()) {
- System.out.println(
- "- ERROR creating output directory '" + outputFile.getParentFile().getAbsolutePath() + "'");
- }
- }
- System.out.println("- Downloading to: " + outputFile.getAbsolutePath());
- try {
- downloadFileFromURL(url, outputFile);
- System.out.println("Done");
- System.exit(0);
- } catch (Throwable e) {
- System.out.println("- Error downloading");
- e.printStackTrace();
- System.exit(1);
- }
- }
-
- private static void downloadFileFromURL(String urlString, File destination) throws Exception {
- if (System.getenv("MVNW_USERNAME") != null && System.getenv("MVNW_PASSWORD") != null) {
- String username = System.getenv("MVNW_USERNAME");
- char[] password = System.getenv("MVNW_PASSWORD").toCharArray();
- Authenticator.setDefault(new Authenticator() {
- @Override
- protected PasswordAuthentication getPasswordAuthentication() {
- return new PasswordAuthentication(username, password);
- }
- });
- }
- URL website = new URL(urlString);
- ReadableByteChannel rbc;
- rbc = Channels.newChannel(website.openStream());
- FileOutputStream fos = new FileOutputStream(destination);
- fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE);
- fos.close();
- rbc.close();
- }
-
-}
diff --git a/binders/kafka-binder/.mvn/wrapper/maven-wrapper.jar b/binders/kafka-binder/.mvn/wrapper/maven-wrapper.jar
deleted file mode 100644
index 2cc7d4a55..000000000
Binary files a/binders/kafka-binder/.mvn/wrapper/maven-wrapper.jar and /dev/null differ
diff --git a/binders/kafka-binder/.mvn/wrapper/maven-wrapper.properties b/binders/kafka-binder/.mvn/wrapper/maven-wrapper.properties
deleted file mode 100644
index 642d572ce..000000000
--- a/binders/kafka-binder/.mvn/wrapper/maven-wrapper.properties
+++ /dev/null
@@ -1,2 +0,0 @@
-distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip
-wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar
diff --git a/binders/kafka-binder/.settings.xml b/binders/kafka-binder/.settings.xml
deleted file mode 100644
index 3da1ea205..000000000
--- a/binders/kafka-binder/.settings.xml
+++ /dev/null
@@ -1,66 +0,0 @@
-
-
-
-
- repo.spring.io
- ${env.CI_DEPLOY_USERNAME}
- ${env.CI_DEPLOY_PASSWORD}
-
-
-
-
-
- spring
- true
-
-
- spring-snapshots
- Spring Snapshots
- https://repo.spring.io/libs-snapshot-local
-
- true
-
-
-
- spring-milestones
- Spring Milestones
- https://repo.spring.io/libs-milestone-local
-
- false
-
-
-
- spring-releases
- Spring Releases
- https://repo.spring.io/release
-
- false
-
-
-
-
-
- spring-snapshots
- Spring Snapshots
- https://repo.spring.io/libs-snapshot-local
-
- true
-
-
-
- spring-milestones
- Spring Milestones
- https://repo.spring.io/libs-milestone-local
-
- false
-
-
-
-
-
-
diff --git a/binders/kafka-binder/LICENSE b/binders/kafka-binder/LICENSE
deleted file mode 100644
index 9b259bdfc..000000000
--- a/binders/kafka-binder/LICENSE
+++ /dev/null
@@ -1,201 +0,0 @@
- Apache License
- Version 2.0, January 2004
- https://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "{}"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright {yyyy} {name of copyright owner}
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- https://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
diff --git a/binders/kafka-binder/mvnw b/binders/kafka-binder/mvnw
deleted file mode 100755
index 41c0f0c23..000000000
--- a/binders/kafka-binder/mvnw
+++ /dev/null
@@ -1,310 +0,0 @@
-#!/bin/sh
-# ----------------------------------------------------------------------------
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-# ----------------------------------------------------------------------------
-
-# ----------------------------------------------------------------------------
-# Maven Start Up Batch script
-#
-# Required ENV vars:
-# ------------------
-# JAVA_HOME - location of a JDK home dir
-#
-# Optional ENV vars
-# -----------------
-# M2_HOME - location of maven2's installed home dir
-# MAVEN_OPTS - parameters passed to the Java VM when running Maven
-# e.g. to debug Maven itself, use
-# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
-# MAVEN_SKIP_RC - flag to disable loading of mavenrc files
-# ----------------------------------------------------------------------------
-
-if [ -z "$MAVEN_SKIP_RC" ] ; then
-
- if [ -f /etc/mavenrc ] ; then
- . /etc/mavenrc
- fi
-
- if [ -f "$HOME/.mavenrc" ] ; then
- . "$HOME/.mavenrc"
- fi
-
-fi
-
-# OS specific support. $var _must_ be set to either true or false.
-cygwin=false;
-darwin=false;
-mingw=false
-case "`uname`" in
- CYGWIN*) cygwin=true ;;
- MINGW*) mingw=true;;
- Darwin*) darwin=true
- # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home
- # See https://developer.apple.com/library/mac/qa/qa1170/_index.html
- if [ -z "$JAVA_HOME" ]; then
- if [ -x "/usr/libexec/java_home" ]; then
- export JAVA_HOME="`/usr/libexec/java_home`"
- else
- export JAVA_HOME="/Library/Java/Home"
- fi
- fi
- ;;
-esac
-
-if [ -z "$JAVA_HOME" ] ; then
- if [ -r /etc/gentoo-release ] ; then
- JAVA_HOME=`java-config --jre-home`
- fi
-fi
-
-if [ -z "$M2_HOME" ] ; then
- ## resolve links - $0 may be a link to maven's home
- PRG="$0"
-
- # need this for relative symlinks
- while [ -h "$PRG" ] ; do
- ls=`ls -ld "$PRG"`
- link=`expr "$ls" : '.*-> \(.*\)$'`
- if expr "$link" : '/.*' > /dev/null; then
- PRG="$link"
- else
- PRG="`dirname "$PRG"`/$link"
- fi
- done
-
- saveddir=`pwd`
-
- M2_HOME=`dirname "$PRG"`/..
-
- # make it fully qualified
- M2_HOME=`cd "$M2_HOME" && pwd`
-
- cd "$saveddir"
- # echo Using m2 at $M2_HOME
-fi
-
-# For Cygwin, ensure paths are in UNIX format before anything is touched
-if $cygwin ; then
- [ -n "$M2_HOME" ] &&
- M2_HOME=`cygpath --unix "$M2_HOME"`
- [ -n "$JAVA_HOME" ] &&
- JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
- [ -n "$CLASSPATH" ] &&
- CLASSPATH=`cygpath --path --unix "$CLASSPATH"`
-fi
-
-# For Mingw, ensure paths are in UNIX format before anything is touched
-if $mingw ; then
- [ -n "$M2_HOME" ] &&
- M2_HOME="`(cd "$M2_HOME"; pwd)`"
- [ -n "$JAVA_HOME" ] &&
- JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`"
-fi
-
-if [ -z "$JAVA_HOME" ]; then
- javaExecutable="`which javac`"
- if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then
- # readlink(1) is not available as standard on Solaris 10.
- readLink=`which readlink`
- if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then
- if $darwin ; then
- javaHome="`dirname \"$javaExecutable\"`"
- javaExecutable="`cd \"$javaHome\" && pwd -P`/javac"
- else
- javaExecutable="`readlink -f \"$javaExecutable\"`"
- fi
- javaHome="`dirname \"$javaExecutable\"`"
- javaHome=`expr "$javaHome" : '\(.*\)/bin'`
- JAVA_HOME="$javaHome"
- export JAVA_HOME
- fi
- fi
-fi
-
-if [ -z "$JAVACMD" ] ; then
- if [ -n "$JAVA_HOME" ] ; then
- if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
- # IBM's JDK on AIX uses strange locations for the executables
- JAVACMD="$JAVA_HOME/jre/sh/java"
- else
- JAVACMD="$JAVA_HOME/bin/java"
- fi
- else
- JAVACMD="`which java`"
- fi
-fi
-
-if [ ! -x "$JAVACMD" ] ; then
- echo "Error: JAVA_HOME is not defined correctly." >&2
- echo " We cannot execute $JAVACMD" >&2
- exit 1
-fi
-
-if [ -z "$JAVA_HOME" ] ; then
- echo "Warning: JAVA_HOME environment variable is not set."
-fi
-
-CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher
-
-# traverses directory structure from process work directory to filesystem root
-# first directory with .mvn subdirectory is considered project base directory
-find_maven_basedir() {
-
- if [ -z "$1" ]
- then
- echo "Path not specified to find_maven_basedir"
- return 1
- fi
-
- basedir="$1"
- wdir="$1"
- while [ "$wdir" != '/' ] ; do
- if [ -d "$wdir"/.mvn ] ; then
- basedir=$wdir
- break
- fi
- # workaround for JBEAP-8937 (on Solaris 10/Sparc)
- if [ -d "${wdir}" ]; then
- wdir=`cd "$wdir/.."; pwd`
- fi
- # end of workaround
- done
- echo "${basedir}"
-}
-
-# concatenates all lines of a file
-concat_lines() {
- if [ -f "$1" ]; then
- echo "$(tr -s '\n' ' ' < "$1")"
- fi
-}
-
-BASE_DIR=`find_maven_basedir "$(pwd)"`
-if [ -z "$BASE_DIR" ]; then
- exit 1;
-fi
-
-##########################################################################################
-# Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
-# This allows using the maven wrapper in projects that prohibit checking in binary data.
-##########################################################################################
-if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then
- if [ "$MVNW_VERBOSE" = true ]; then
- echo "Found .mvn/wrapper/maven-wrapper.jar"
- fi
-else
- if [ "$MVNW_VERBOSE" = true ]; then
- echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..."
- fi
- if [ -n "$MVNW_REPOURL" ]; then
- jarUrl="$MVNW_REPOURL/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
- else
- jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
- fi
- while IFS="=" read key value; do
- case "$key" in (wrapperUrl) jarUrl="$value"; break ;;
- esac
- done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties"
- if [ "$MVNW_VERBOSE" = true ]; then
- echo "Downloading from: $jarUrl"
- fi
- wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar"
- if $cygwin; then
- wrapperJarPath=`cygpath --path --windows "$wrapperJarPath"`
- fi
-
- if command -v wget > /dev/null; then
- if [ "$MVNW_VERBOSE" = true ]; then
- echo "Found wget ... using wget"
- fi
- if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
- wget "$jarUrl" -O "$wrapperJarPath"
- else
- wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath"
- fi
- elif command -v curl > /dev/null; then
- if [ "$MVNW_VERBOSE" = true ]; then
- echo "Found curl ... using curl"
- fi
- if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
- curl -o "$wrapperJarPath" "$jarUrl" -f
- else
- curl --user $MVNW_USERNAME:$MVNW_PASSWORD -o "$wrapperJarPath" "$jarUrl" -f
- fi
-
- else
- if [ "$MVNW_VERBOSE" = true ]; then
- echo "Falling back to using Java to download"
- fi
- javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java"
- # For Cygwin, switch paths to Windows format before running javac
- if $cygwin; then
- javaClass=`cygpath --path --windows "$javaClass"`
- fi
- if [ -e "$javaClass" ]; then
- if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
- if [ "$MVNW_VERBOSE" = true ]; then
- echo " - Compiling MavenWrapperDownloader.java ..."
- fi
- # Compiling the Java class
- ("$JAVA_HOME/bin/javac" "$javaClass")
- fi
- if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
- # Running the downloader
- if [ "$MVNW_VERBOSE" = true ]; then
- echo " - Running MavenWrapperDownloader.java ..."
- fi
- ("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR")
- fi
- fi
- fi
-fi
-##########################################################################################
-# End of extension
-##########################################################################################
-
-export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"}
-if [ "$MVNW_VERBOSE" = true ]; then
- echo $MAVEN_PROJECTBASEDIR
-fi
-MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS"
-
-# For Cygwin, switch paths to Windows format before running java
-if $cygwin; then
- [ -n "$M2_HOME" ] &&
- M2_HOME=`cygpath --path --windows "$M2_HOME"`
- [ -n "$JAVA_HOME" ] &&
- JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"`
- [ -n "$CLASSPATH" ] &&
- CLASSPATH=`cygpath --path --windows "$CLASSPATH"`
- [ -n "$MAVEN_PROJECTBASEDIR" ] &&
- MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"`
-fi
-
-# Provide a "standardized" way to retrieve the CLI args that will
-# work with both Windows and non-Windows executions.
-MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@"
-export MAVEN_CMD_LINE_ARGS
-
-WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
-
-exec "$JAVACMD" \
- $MAVEN_OPTS \
- -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \
- "-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \
- ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@"
diff --git a/binders/kafka-binder/mvnw.cmd b/binders/kafka-binder/mvnw.cmd
deleted file mode 100644
index 86115719e..000000000
--- a/binders/kafka-binder/mvnw.cmd
+++ /dev/null
@@ -1,182 +0,0 @@
-@REM ----------------------------------------------------------------------------
-@REM Licensed to the Apache Software Foundation (ASF) under one
-@REM or more contributor license agreements. See the NOTICE file
-@REM distributed with this work for additional information
-@REM regarding copyright ownership. The ASF licenses this file
-@REM to you under the Apache License, Version 2.0 (the
-@REM "License"); you may not use this file except in compliance
-@REM with the License. You may obtain a copy of the License at
-@REM
-@REM http://www.apache.org/licenses/LICENSE-2.0
-@REM
-@REM Unless required by applicable law or agreed to in writing,
-@REM software distributed under the License is distributed on an
-@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-@REM KIND, either express or implied. See the License for the
-@REM specific language governing permissions and limitations
-@REM under the License.
-@REM ----------------------------------------------------------------------------
-
-@REM ----------------------------------------------------------------------------
-@REM Maven Start Up Batch script
-@REM
-@REM Required ENV vars:
-@REM JAVA_HOME - location of a JDK home dir
-@REM
-@REM Optional ENV vars
-@REM M2_HOME - location of maven2's installed home dir
-@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands
-@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a keystroke before ending
-@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven
-@REM e.g. to debug Maven itself, use
-@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
-@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files
-@REM ----------------------------------------------------------------------------
-
-@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on'
-@echo off
-@REM set title of command window
-title %0
-@REM enable echoing by setting MAVEN_BATCH_ECHO to 'on'
-@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO%
-
-@REM set %HOME% to equivalent of $HOME
-if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%")
-
-@REM Execute a user defined script before this one
-if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre
-@REM check for pre script, once with legacy .bat ending and once with .cmd ending
-if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat"
-if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd"
-:skipRcPre
-
-@setlocal
-
-set ERROR_CODE=0
-
-@REM To isolate internal variables from possible post scripts, we use another setlocal
-@setlocal
-
-@REM ==== START VALIDATION ====
-if not "%JAVA_HOME%" == "" goto OkJHome
-
-echo.
-echo Error: JAVA_HOME not found in your environment. >&2
-echo Please set the JAVA_HOME variable in your environment to match the >&2
-echo location of your Java installation. >&2
-echo.
-goto error
-
-:OkJHome
-if exist "%JAVA_HOME%\bin\java.exe" goto init
-
-echo.
-echo Error: JAVA_HOME is set to an invalid directory. >&2
-echo JAVA_HOME = "%JAVA_HOME%" >&2
-echo Please set the JAVA_HOME variable in your environment to match the >&2
-echo location of your Java installation. >&2
-echo.
-goto error
-
-@REM ==== END VALIDATION ====
-
-:init
-
-@REM Find the project base dir, i.e. the directory that contains the folder ".mvn".
-@REM Fallback to current working directory if not found.
-
-set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR%
-IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir
-
-set EXEC_DIR=%CD%
-set WDIR=%EXEC_DIR%
-:findBaseDir
-IF EXIST "%WDIR%"\.mvn goto baseDirFound
-cd ..
-IF "%WDIR%"=="%CD%" goto baseDirNotFound
-set WDIR=%CD%
-goto findBaseDir
-
-:baseDirFound
-set MAVEN_PROJECTBASEDIR=%WDIR%
-cd "%EXEC_DIR%"
-goto endDetectBaseDir
-
-:baseDirNotFound
-set MAVEN_PROJECTBASEDIR=%EXEC_DIR%
-cd "%EXEC_DIR%"
-
-:endDetectBaseDir
-
-IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig
-
-@setlocal EnableExtensions EnableDelayedExpansion
-for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a
-@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS%
-
-:endReadAdditionalConfig
-
-SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe"
-set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar"
-set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
-
-set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
-
-FOR /F "tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO (
- IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B
-)
-
-@REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
-@REM This allows using the maven wrapper in projects that prohibit checking in binary data.
-if exist %WRAPPER_JAR% (
- if "%MVNW_VERBOSE%" == "true" (
- echo Found %WRAPPER_JAR%
- )
-) else (
- if not "%MVNW_REPOURL%" == "" (
- SET DOWNLOAD_URL="%MVNW_REPOURL%/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
- )
- if "%MVNW_VERBOSE%" == "true" (
- echo Couldn't find %WRAPPER_JAR%, downloading it ...
- echo Downloading from: %DOWNLOAD_URL%
- )
-
- powershell -Command "&{"^
- "$webclient = new-object System.Net.WebClient;"^
- "if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^
- "$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^
- "}"^
- "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"^
- "}"
- if "%MVNW_VERBOSE%" == "true" (
- echo Finished downloading %WRAPPER_JAR%
- )
-)
-@REM End of extension
-
-@REM Provide a "standardized" way to retrieve the CLI args that will
-@REM work with both Windows and non-Windows executions.
-set MAVEN_CMD_LINE_ARGS=%*
-
-%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %*
-if ERRORLEVEL 1 goto error
-goto end
-
-:error
-set ERROR_CODE=1
-
-:end
-@endlocal & set ERROR_CODE=%ERROR_CODE%
-
-if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost
-@REM check for post script, once with legacy .bat ending and once with .cmd ending
-if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat"
-if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd"
-:skipRcPost
-
-@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on'
-if "%MAVEN_BATCH_PAUSE%" == "on" pause
-
-if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE%
-
-exit /B %ERROR_CODE%
diff --git a/binders/kafka-binder/pom.xml b/binders/kafka-binder/pom.xml
deleted file mode 100644
index 796019ee8..000000000
--- a/binders/kafka-binder/pom.xml
+++ /dev/null
@@ -1,182 +0,0 @@
-
-
- 4.0.0
- spring-cloud-stream-binder-kafka-parent
- 4.1.0-SNAPSHOT
- pom
-
- org.springframework.cloud
- spring-cloud-stream-binders
- 4.1.0-SNAPSHOT
-
-
- https://github.com/spring-cloud/spring-cloud-stream-binder-kafka
- scm:git:git://github.com/spring-cloud/spring-cloud-stream-binder-kafka.git
-
-
- scm:git:ssh://git@github.com/spring-cloud/spring-cloud-stream-binder-kafka.git
-
- HEAD
-
-
- 17
- true
- true
- true
-
-
- spring-cloud-stream-binder-kafka
- spring-cloud-starter-stream-kafka
- spring-cloud-stream-binder-kafka-core
- spring-cloud-stream-binder-kafka-streams
- spring-cloud-stream-binder-kafka-reactive
-
-
-
-
- org.junit.vintage
- junit-vintage-engine
- test
-
-
-
-
-
-
-
- org.apache.maven.plugins
- maven-antrun-plugin
-
-
-
- org.apache.maven.plugins
- maven-javadoc-plugin
-
- true
-
-
-
- org.apache.maven.plugins
- maven-surefire-plugin
- 3.0.0-M7
-
- true
-
-
-
-
-
-
- org.apache.maven.plugins
- maven-compiler-plugin
- ${maven-compiler-plugin.version}
-
- ${java.version}
- ${java.version}
- -parameters
-
-
-
- org.apache.maven.plugins
- maven-checkstyle-plugin
-
-
-
-
-
-
- spring
-
-
-
-
- coverage
-
-
- env.TRAVIS
- true
-
-
-
-
-
- org.jacoco
- jacoco-maven-plugin
- 0.7.9
-
-
- agent
-
- prepare-agent
-
-
-
- report
- test
-
- report
-
-
-
-
-
-
-
-
-
-
- spring-snapshots
- Spring Snapshots
- https://repo.spring.io/libs-snapshot-local
-
-
- spring-milestones
- Spring milestones
- https://repo.spring.io/libs-milestone-local
-
-
- rsocket-snapshots
- RSocket Snapshots
- https://oss.jfrog.org/oss-snapshot-local
-
- true
-
-
-
- spring-releases
- Spring Releases
- https://repo.spring.io/release
-
-
-
-
- spring-snapshots
- Spring Snapshots
- https://repo.spring.io/snapshot
-
- true
-
-
-
- spring-milestones
- Spring Milestones
- https://repo.spring.io/milestone
-
- false
-
-
-
- spring-releases
- Spring Releases
- https://repo.spring.io/release
-
-
-
-
-
- org.apache.maven.plugins
- maven-checkstyle-plugin
-
-
-
-
diff --git a/binders/kafka-binder/spring-cloud-starter-stream-kafka/.jdk8 b/binders/kafka-binder/spring-cloud-starter-stream-kafka/.jdk8
deleted file mode 100644
index e69de29bb..000000000
diff --git a/binders/kafka-binder/spring-cloud-starter-stream-kafka/pom.xml b/binders/kafka-binder/spring-cloud-starter-stream-kafka/pom.xml
deleted file mode 100644
index 0195eccfa..000000000
--- a/binders/kafka-binder/spring-cloud-starter-stream-kafka/pom.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-
-
- 4.0.0
-
- org.springframework.cloud
- spring-cloud-stream-binder-kafka-parent
- 4.1.0-SNAPSHOT
-
- spring-cloud-starter-stream-kafka
- Spring Cloud Starter Stream Kafka
- https://projects.spring.io/spring-cloud
-
- Pivotal Software, Inc.
- https://www.spring.io
-
-
- ${basedir}/../..
-
-
-
- org.springframework.cloud
- spring-cloud-stream-binder-kafka
- ${project.version}
-
-
-
diff --git a/binders/kafka-binder/spring-cloud-stream-binder-kafka-core/.jdk8 b/binders/kafka-binder/spring-cloud-stream-binder-kafka-core/.jdk8
deleted file mode 100644
index e69de29bb..000000000
diff --git a/binders/kafka-binder/spring-cloud-stream-binder-kafka-core/pom.xml b/binders/kafka-binder/spring-cloud-stream-binder-kafka-core/pom.xml
deleted file mode 100644
index 6091fcbd4..000000000
--- a/binders/kafka-binder/spring-cloud-stream-binder-kafka-core/pom.xml
+++ /dev/null
@@ -1,49 +0,0 @@
-
-
- 4.0.0
-
- org.springframework.cloud
- spring-cloud-stream-binder-kafka-parent
- 4.1.0-SNAPSHOT
-
- spring-cloud-stream-binder-kafka-core
- Spring Cloud Stream Kafka Binder Core
- https://projects.spring.io/spring-cloud
-
- Pivotal Software, Inc.
- https://www.spring.io
-
-
-
-
- org.springframework.cloud
- spring-cloud-stream
-
-
- org.springframework.integration
- spring-integration-kafka
-
-
- org.springframework.boot
- spring-boot-starter-actuator
- true
-
-
- org.springframework.boot
- spring-boot-configuration-processor
- true
-
-
- org.springframework.kafka
- spring-kafka-test
- test
-
-
- org.springframework.boot
- spring-boot-starter-test
- test
-
-
-
-
diff --git a/binders/kafka-binder/spring-cloud-stream-binder-kafka-core/src/main/java/org/springframework/cloud/stream/binder/kafka/common/AbstractKafkaBinderHealthIndicator.java b/binders/kafka-binder/spring-cloud-stream-binder-kafka-core/src/main/java/org/springframework/cloud/stream/binder/kafka/common/AbstractKafkaBinderHealthIndicator.java
deleted file mode 100644
index e4cf87d8b..000000000
--- a/binders/kafka-binder/spring-cloud-stream-binder-kafka-core/src/main/java/org/springframework/cloud/stream/binder/kafka/common/AbstractKafkaBinderHealthIndicator.java
+++ /dev/null
@@ -1,205 +0,0 @@
-/*
- * Copyright 2023-2023 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.cloud.stream.binder.kafka.common;
-
-import java.time.Duration;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.concurrent.ExecutionException;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Future;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.TimeoutException;
-
-import org.apache.kafka.clients.consumer.Consumer;
-import org.apache.kafka.common.PartitionInfo;
-
-import org.springframework.beans.factory.DisposableBean;
-import org.springframework.boot.actuate.health.AbstractHealthIndicator;
-import org.springframework.boot.actuate.health.Health;
-import org.springframework.boot.actuate.health.Status;
-import org.springframework.boot.actuate.health.StatusAggregator;
-import org.springframework.kafka.core.ConsumerFactory;
-import org.springframework.util.Assert;
-
-/**
- * Base class that abstracts the common health indicator details for the various Kafka binder flavors.
- *
- * @author Soby Chacko
- * @since 4.1.0
- */
-public abstract class AbstractKafkaBinderHealthIndicator extends AbstractHealthIndicator implements DisposableBean {
-
- private static final int DEFAULT_TIMEOUT = 60;
-
- protected int timeout = DEFAULT_TIMEOUT;
-
- private final ExecutorService executor;
-
- protected Consumer, ?> metadataConsumer;
-
- protected boolean considerDownWhenAnyPartitionHasNoLeader;
-
- private final ConsumerFactory, ?> consumerFactory;
-
- public AbstractKafkaBinderHealthIndicator(ConsumerFactory, ?> consumerFactory) {
- this.consumerFactory = consumerFactory;
- this.executor = createHealthBinderExecutorService();
- Assert.notNull(this.executor, "The health indicator executor service must not be null");
- }
-
- protected abstract Map getTopicsInUse();
-
- protected abstract Health buildBinderSpecificHealthDetails();
-
- protected abstract ExecutorService createHealthBinderExecutorService();
-
- private void initMetadataConsumer() {
- if (this.metadataConsumer == null) {
- this.metadataConsumer = this.consumerFactory.createConsumer();
- }
- }
-
- @Override
- public void destroy() {
- executor.shutdown();
- if (this.metadataConsumer != null) {
- this.metadataConsumer.close();
- }
- }
-
- @Override
- protected void doHealthCheck(Health.Builder builder) throws Exception {
- Health topicsHealth = safelyBuildTopicsHealth();
- Health listenerContainersHealth = buildBinderSpecificHealthDetails();
- merge(topicsHealth, listenerContainersHealth, builder);
- }
-
- protected Health safelyBuildTopicsHealth() {
- Future future = executor.submit(this::buildTopicsHealth);
- try {
- return future.get(this.timeout, TimeUnit.SECONDS);
- }
- catch (InterruptedException ex) {
- Thread.currentThread().interrupt();
- return Health.down()
- .withDetail("Interrupted while waiting for partition information in",
- this.timeout + " seconds")
- .build();
- }
- catch (ExecutionException ex) {
- return Health.down(ex).build();
- }
- catch (TimeoutException ex) {
- return Health.down().withDetail("Failed to retrieve partition information in",
- this.timeout + " seconds").build();
- }
- }
-
- private Health buildTopicsHealth() {
- try {
- initMetadataConsumer();
- Set downMessages = new HashSet<>();
- Set checkedTopics = new HashSet<>();
- final Map topicsInUse = getTopicsInUse();
- if (topicsInUse.isEmpty()) {
- try {
- this.metadataConsumer.listTopics(Duration.ofSeconds(this.timeout));
- }
- catch (Exception e) {
- return Health.down().withDetail("No topic information available",
- "Kafka broker is not reachable").build();
- }
- return Health.unknown().withDetail("No bindings found",
- "Kafka binder may not be bound to destinations on the broker").build();
- }
- else {
- for (String topic : topicsInUse.keySet()) {
- TopicInformation topicInformation = topicsInUse
- .get(topic);
- if (!topicInformation.isTopicPattern()) {
- List partitionInfos = this.metadataConsumer
- .partitionsFor(topic);
- for (PartitionInfo partitionInfo : partitionInfos) {
- if (topicInformation.partitionInfos()
- .contains(partitionInfo)
- && partitionInfo.leader() == null ||
- (partitionInfo.leader() != null && partitionInfo.leader().id() == -1)) {
- downMessages.add(partitionInfo.toString());
- }
- else if (this.considerDownWhenAnyPartitionHasNoLeader &&
- partitionInfo.leader() == null || (partitionInfo.leader() != null && partitionInfo.leader().id() == -1)) {
- downMessages.add(partitionInfo.toString());
- }
- }
- checkedTopics.add(topic);
- }
- else {
- try {
- // Since destination is a pattern, all we are doing is just to make sure that
- // we can connect to the cluster and query the topics.
- this.metadataConsumer.listTopics(Duration.ofSeconds(this.timeout));
- }
- catch (Exception ex) {
- return Health.down()
- .withDetail("Cluster not connected",
- "Destination provided is a pattern, but cannot connect to the cluster for any verification")
- .build();
- }
- }
- }
- }
- if (downMessages.isEmpty()) {
- return Health.up().withDetail("topicsInUse", checkedTopics).build();
- }
- else {
- return Health.down()
- .withDetail("Following partitions in use have no leaders: ",
- downMessages.toString())
- .build();
- }
- }
- catch (Exception ex) {
- return Health.down(ex).build();
- }
- }
-
- private void merge(Health topicsHealth, Health listenerContainersHealth, Health.Builder builder) {
- Status aggregatedStatus = StatusAggregator.getDefault()
- .getAggregateStatus(topicsHealth.getStatus(), listenerContainersHealth.getStatus());
- Map aggregatedDetails = new HashMap<>();
- aggregatedDetails.putAll(topicsHealth.getDetails());
- aggregatedDetails.putAll(listenerContainersHealth.getDetails());
- builder.status(aggregatedStatus).withDetails(aggregatedDetails);
- }
-
- /**
- * Set the timeout in seconds to retrieve health information.
- *
- * @param timeout the timeout - default 60.
- */
- public void setTimeout(int timeout) {
- this.timeout = timeout;
- }
-
- public void setConsiderDownWhenAnyPartitionHasNoLeader(boolean considerDownWhenAnyPartitionHasNoLeader) {
- this.considerDownWhenAnyPartitionHasNoLeader = considerDownWhenAnyPartitionHasNoLeader;
- }
-}
diff --git a/binders/kafka-binder/spring-cloud-stream-binder-kafka-core/src/main/java/org/springframework/cloud/stream/binder/kafka/common/KafkaBinderEnvironmentPostProcessor.java b/binders/kafka-binder/spring-cloud-stream-binder-kafka-core/src/main/java/org/springframework/cloud/stream/binder/kafka/common/KafkaBinderEnvironmentPostProcessor.java
deleted file mode 100644
index 203afb9b0..000000000
--- a/binders/kafka-binder/spring-cloud-stream-binder-kafka-core/src/main/java/org/springframework/cloud/stream/binder/kafka/common/KafkaBinderEnvironmentPostProcessor.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * Copyright 2017-2019 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.cloud.stream.binder.kafka.common;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.apache.kafka.common.serialization.ByteArrayDeserializer;
-import org.apache.kafka.common.serialization.ByteArraySerializer;
-
-import org.springframework.boot.SpringApplication;
-import org.springframework.boot.env.EnvironmentPostProcessor;
-import org.springframework.core.env.ConfigurableEnvironment;
-import org.springframework.core.env.MapPropertySource;
-
-/**
- * An {@link EnvironmentPostProcessor} that sets some common configuration properties (log
- * config etc.,) for Kafka binder.
- *
- * @author Ilayaperumal Gopinathan
- */
-public class KafkaBinderEnvironmentPostProcessor implements EnvironmentPostProcessor {
-
- private static final String SPRING_KAFKA = "spring.kafka";
-
- private static final String SPRING_KAFKA_PRODUCER = SPRING_KAFKA + ".producer";
-
- private static final String SPRING_KAFKA_CONSUMER = SPRING_KAFKA + ".consumer";
-
- private static final String SPRING_KAFKA_PRODUCER_KEY_SERIALIZER = SPRING_KAFKA_PRODUCER
- + "." + "keySerializer";
-
- private static final String SPRING_KAFKA_PRODUCER_VALUE_SERIALIZER = SPRING_KAFKA_PRODUCER
- + "." + "valueSerializer";
-
- private static final String SPRING_KAFKA_CONSUMER_KEY_DESERIALIZER = SPRING_KAFKA_CONSUMER
- + "." + "keyDeserializer";
-
- private static final String SPRING_KAFKA_CONSUMER_VALUE_DESERIALIZER = SPRING_KAFKA_CONSUMER
- + "." + "valueDeserializer";
-
- private static final String KAFKA_BINDER_DEFAULT_PROPERTIES = "kafkaBinderDefaultProperties";
-
- @Override
- public void postProcessEnvironment(ConfigurableEnvironment environment,
- SpringApplication application) {
- if (!environment.getPropertySources().contains(KAFKA_BINDER_DEFAULT_PROPERTIES)) {
- Map kafkaBinderDefaultProperties = new HashMap<>();
- kafkaBinderDefaultProperties.put("logging.level.org.I0Itec.zkclient",
- "ERROR");
- kafkaBinderDefaultProperties.put("logging.level.kafka.server.KafkaConfig",
- "ERROR");
- kafkaBinderDefaultProperties
- .put("logging.level.kafka.admin.AdminClient.AdminConfig", "ERROR");
- kafkaBinderDefaultProperties.put(SPRING_KAFKA_PRODUCER_KEY_SERIALIZER,
- ByteArraySerializer.class.getName());
- kafkaBinderDefaultProperties.put(SPRING_KAFKA_PRODUCER_VALUE_SERIALIZER,
- ByteArraySerializer.class.getName());
- kafkaBinderDefaultProperties.put(SPRING_KAFKA_CONSUMER_KEY_DESERIALIZER,
- ByteArrayDeserializer.class.getName());
- kafkaBinderDefaultProperties.put(SPRING_KAFKA_CONSUMER_VALUE_DESERIALIZER,
- ByteArrayDeserializer.class.getName());
- environment.getPropertySources().addLast(new MapPropertySource(
- KAFKA_BINDER_DEFAULT_PROPERTIES, kafkaBinderDefaultProperties));
- }
- }
-
-}
diff --git a/binders/kafka-binder/spring-cloud-stream-binder-kafka-core/src/main/java/org/springframework/cloud/stream/binder/kafka/common/TopicInformation.java b/binders/kafka-binder/spring-cloud-stream-binder-kafka-core/src/main/java/org/springframework/cloud/stream/binder/kafka/common/TopicInformation.java
deleted file mode 100644
index bac2b6901..000000000
--- a/binders/kafka-binder/spring-cloud-stream-binder-kafka-core/src/main/java/org/springframework/cloud/stream/binder/kafka/common/TopicInformation.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright 2023-2023 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.cloud.stream.binder.kafka.common;
-
-import java.util.Collection;
-
-import org.apache.kafka.common.PartitionInfo;
-
-/**
- * Record to capture topic information for various binder related tasks.
- *
- * @param consumerGroup consumer group for the consumer
- * @param partitionInfos collection of {@link PartitionInfo}
- * @param isTopicPattern if the topic is specified as a pattern
- *
- * @author Soby Chacko (and previous authors before refactoring).
- */
-public record TopicInformation(String consumerGroup, Collection partitionInfos, boolean isTopicPattern) {
-
- public boolean isConsumerTopic() {
- return this.consumerGroup != null;
- }
-}
diff --git a/binders/kafka-binder/spring-cloud-stream-binder-kafka-core/src/main/java/org/springframework/cloud/stream/binder/kafka/properties/JaasLoginModuleConfiguration.java b/binders/kafka-binder/spring-cloud-stream-binder-kafka-core/src/main/java/org/springframework/cloud/stream/binder/kafka/properties/JaasLoginModuleConfiguration.java
deleted file mode 100644
index 9934f30dd..000000000
--- a/binders/kafka-binder/spring-cloud-stream-binder-kafka-core/src/main/java/org/springframework/cloud/stream/binder/kafka/properties/JaasLoginModuleConfiguration.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Copyright 2016-2018 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.cloud.stream.binder.kafka.properties;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import javax.security.auth.login.AppConfigurationEntry;
-
-import org.springframework.kafka.security.jaas.KafkaJaasLoginModuleInitializer;
-import org.springframework.util.Assert;
-
-/**
- * Contains properties for setting up an {@link AppConfigurationEntry} that can be used
- * for the Kafka or Zookeeper client.
- *
- * @author Marius Bogoevici
- * @author Soby Chacko
- */
-public class JaasLoginModuleConfiguration {
-
- private String loginModule = "com.sun.security.auth.module.Krb5LoginModule";
-
- private KafkaJaasLoginModuleInitializer.ControlFlag controlFlag = KafkaJaasLoginModuleInitializer.ControlFlag.REQUIRED;
-
- private Map options = new HashMap<>();
-
- public String getLoginModule() {
- return this.loginModule;
- }
-
- public void setLoginModule(String loginModule) {
- Assert.notNull(loginModule, "cannot be null");
- this.loginModule = loginModule;
- }
-
- public KafkaJaasLoginModuleInitializer.ControlFlag getControlFlag() {
- return this.controlFlag;
- }
-
- public void setControlFlag(String controlFlag) {
- Assert.notNull(controlFlag, "cannot be null");
- this.controlFlag = KafkaJaasLoginModuleInitializer.ControlFlag
- .valueOf(controlFlag.toUpperCase());
- }
-
- public Map getOptions() {
- return this.options;
- }
-
- public void setOptions(Map options) {
- this.options = options;
- }
-
-}
diff --git a/binders/kafka-binder/spring-cloud-stream-binder-kafka-core/src/main/java/org/springframework/cloud/stream/binder/kafka/properties/KafkaBinderConfigurationProperties.java b/binders/kafka-binder/spring-cloud-stream-binder-kafka-core/src/main/java/org/springframework/cloud/stream/binder/kafka/properties/KafkaBinderConfigurationProperties.java
deleted file mode 100644
index 13beac13f..000000000
--- a/binders/kafka-binder/spring-cloud-stream-binder-kafka-core/src/main/java/org/springframework/cloud/stream/binder/kafka/properties/KafkaBinderConfigurationProperties.java
+++ /dev/null
@@ -1,723 +0,0 @@
-/*
- * Copyright 2015-2023 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.cloud.stream.binder.kafka.properties;
-
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.nio.file.Files;
-import java.nio.file.Path;
-import java.nio.file.Paths;
-import java.nio.file.StandardCopyOption;
-import java.time.Duration;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-
-import jakarta.validation.constraints.AssertTrue;
-import jakarta.validation.constraints.Min;
-import jakarta.validation.constraints.NotNull;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.kafka.clients.consumer.ConsumerConfig;
-import org.apache.kafka.clients.producer.ProducerConfig;
-
-import org.springframework.boot.autoconfigure.kafka.KafkaProperties;
-import org.springframework.cloud.stream.binder.HeaderMode;
-import org.springframework.cloud.stream.binder.ProducerProperties;
-import org.springframework.cloud.stream.binder.kafka.properties.KafkaProducerProperties.CompressionType;
-import org.springframework.core.io.DefaultResourceLoader;
-import org.springframework.core.io.Resource;
-import org.springframework.expression.Expression;
-import org.springframework.util.Assert;
-import org.springframework.util.ObjectUtils;
-import org.springframework.util.StringUtils;
-
-/**
- * Configuration properties for the Kafka binder. The properties in this class are
- * prefixed with spring.cloud.stream.kafka.binder.
- *
- * @author David Turanski
- * @author Ilayaperumal Gopinathan
- * @author Marius Bogoevici
- * @author Soby Chacko
- * @author Gary Russell
- * @author Rafal Zukowski
- * @author Aldo Sinanaj
- * @author Lukasz Kaminski
- * @author Chukwubuikem Ume-Ugwa
- * @author Nico Heller
- * @author Norbert Gyurian
- */
-public class KafkaBinderConfigurationProperties {
-
- private static final String DEFAULT_KAFKA_CONNECTION_STRING = "localhost:9092";
-
- private final Log logger = LogFactory.getLog(getClass());
-
- private final Transaction transaction = new Transaction();
-
- private final Metrics metrics = new Metrics();
-
- private final KafkaProperties kafkaProperties;
-
- /**
- * Arbitrary kafka properties that apply to both producers and consumers.
- */
- private Map configuration = new HashMap<>();
-
- /**
- * Arbitrary kafka consumer properties.
- */
- private Map consumerProperties = new HashMap<>();
-
- /**
- * Arbitrary kafka producer properties.
- */
- private Map producerProperties = new HashMap<>();
-
- private String[] brokers = new String[] { "localhost" };
-
- private String defaultBrokerPort = "9092";
-
- private String[] headers = new String[] {};
-
- private boolean autoCreateTopics = true;
-
- private boolean autoAlterTopics;
-
- private boolean autoAddPartitions;
-
- private boolean considerDownWhenAnyPartitionHasNoLeader;
-
- private String requiredAcks = "1";
-
- private short replicationFactor = -1;
-
- private int minPartitionCount = 1;
-
- /**
- * Time to wait to get partition information in seconds; default 60.
- */
- private int healthTimeout = 60;
-
- private JaasLoginModuleConfiguration jaas;
-
- /**
- * The bean name of a custom header mapper to use instead of a
- * {@link org.springframework.kafka.support.DefaultKafkaHeaderMapper}.
- */
- private String headerMapperBeanName;
-
- /**
- * Time between retries after AuthorizationException is caught in
- * the ListenerContainer; defalt is null which disables retries.
- * For more info see: {@link org.springframework.kafka.listener.ConsumerProperties#setAuthorizationExceptionRetryInterval(java.time.Duration)}
- */
- private Duration authorizationExceptionRetryInterval;
-
- /**
- * When a certificate store location is not given as a local file system path, then the binder
- * converts the path to {@link org.springframework.core.io.Resource} resource, then copies
- * the resource from the original location to a location on
- * the filesystem. If this value is set, then this location is used, otherwise, the
- * certificate file is copied to the directory returned by java.io.tmpdir.
- */
- private String certificateStoreDirectory;
-
- /**
- * Enable Micrometer observation registry across all the bindings in the binder.
- */
- private boolean enableObservation;
-
- /**
- * Earlier, @Autowired on this constructor was necessary for all the properties to be discovered
- * and bound when running as a native application. However, now that Spring Boot fixed the underlying
- * issue, we are removing the @Autowired from the constructor. See these Boot issues for more details.
- * https://github.com/spring-projects/spring-boot/issues/34507
- * https://github.com/spring-projects/spring-boot/issues/35564
- *
- * @param kafkaProperties Spring Kafka properties autoconfigured by Spring Boot
- */
- public KafkaBinderConfigurationProperties(KafkaProperties kafkaProperties) {
- Assert.notNull(kafkaProperties, "'kafkaProperties' cannot be null");
- this.kafkaProperties = kafkaProperties;
- }
-
- public KafkaProperties getKafkaProperties() {
- return this.kafkaProperties;
- }
-
- public Transaction getTransaction() {
- return this.transaction;
- }
-
- public Metrics getMetrics() {
- return metrics;
- }
-
- public String getKafkaConnectionString() {
- // We need to do a check on certificate file locations to see if they are given as non-local file system resources.
- // If that is the case, then we will copy them to a file system location and use those as the certificate locations.
- // This is due to a limitation in Kafka itself in which it doesn't allow reading certificate resources from non-local
- // file system locations e.g. classpath, http.
- // See this: https://issues.apache.org/jira/browse/KAFKA-7685
- // and this: https://cwiki.apache.org/confluence/display/KAFKA/KIP-398%3A+Support+reading+trust+store+from+classpath
- moveCertsToFileSystemIfNecessary();
-
- return toConnectionString(this.brokers, this.defaultBrokerPort);
- }
-
- private void moveCertsToFileSystemIfNecessary() {
- try {
- // broker certificates
- moveCertsIfApplicable("ssl.truststore.location");
- moveCertsIfApplicable("ssl.keystore.location");
-
- // schema registry certificates
- moveCertsIfApplicable("schema.registry.ssl.truststore.location");
- moveCertsIfApplicable("schema.registry.ssl.keystore.location");
- }
- catch (Exception e) {
- throw new IllegalStateException(e);
- }
- }
-
- private void moveCertsIfApplicable(String storeProperty) throws IOException {
- final String storeLocation = this.configuration.get(storeProperty);
-
- // If the path is not defined, or it is a local file path do not move the file
- if (storeLocation != null && !checkIfFileExists(storeLocation)) {
- final String fileSystemLocation = moveCertToFileSystem(storeLocation, this.certificateStoreDirectory);
- // Overriding the value with absolute filesystem path.
- this.configuration.put(storeProperty, fileSystemLocation);
- }
- }
-
- private boolean checkIfFileExists(String path) {
- try {
- return Files.isRegularFile(Paths.get(path));
- }
- catch (Exception e) {
- return false;
- }
- }
-
- private String moveCertToFileSystem(String resourceLocation, String fileSystemLocation) throws IOException {
- File targetFile;
- final String tempDir = System.getProperty("java.io.tmpdir");
- Resource resource = new DefaultResourceLoader().getResource(resourceLocation);
- if (StringUtils.hasText(fileSystemLocation)) {
- final Path path = Paths.get(fileSystemLocation);
- if (!Files.exists(path) || !Files.isDirectory(path) || !Files.isWritable(path)) {
- logger.warn("The filesystem location to move the cert files (" + fileSystemLocation + ") " +
- "is not found or a directory that is writable. The system temp folder (java.io.tmpdir) will be used instead.");
- targetFile = new File(Paths.get(tempDir, resource.getFilename()).toString());
- }
- else {
- // the given location is verified to be a writable directory.
- targetFile = new File(Paths.get(fileSystemLocation, resource.getFilename()).toString());
- }
- }
- else {
- targetFile = new File(Paths.get(tempDir, resource.getFilename()).toString());
- }
-
- try (InputStream inputStream = resource.getInputStream()) {
- Files.copy(inputStream, targetFile.toPath(), StandardCopyOption.REPLACE_EXISTING);
- }
- return targetFile.getAbsolutePath();
- }
-
- public String getDefaultKafkaConnectionString() {
- return DEFAULT_KAFKA_CONNECTION_STRING;
- }
-
- public String[] getHeaders() {
- return this.headers;
- }
-
- public String[] getBrokers() {
- return this.brokers;
- }
-
- public void setBrokers(String... brokers) {
- this.brokers = brokers;
- }
-
- public void setDefaultBrokerPort(String defaultBrokerPort) {
- this.defaultBrokerPort = defaultBrokerPort;
- }
-
- public void setHeaders(String... headers) {
- this.headers = headers;
- }
-
- /**
- * Converts an array of host values to a comma-separated String. It will append the
- * default port value, if not already specified.
- * @param hosts host string
- * @param defaultPort port
- * @return formatted connection string
- */
- private String toConnectionString(String[] hosts, String defaultPort) {
- String[] fullyFormattedHosts = new String[hosts.length];
- for (int i = 0; i < hosts.length; i++) {
- if (hosts[i].contains(":") || !StringUtils.hasText(defaultPort)) {
- fullyFormattedHosts[i] = hosts[i];
- }
- else {
- fullyFormattedHosts[i] = hosts[i] + ":" + defaultPort;
- }
- }
- return StringUtils.arrayToCommaDelimitedString(fullyFormattedHosts);
- }
-
- public String getRequiredAcks() {
- return this.requiredAcks;
- }
-
- public void setRequiredAcks(String requiredAcks) {
- this.requiredAcks = requiredAcks;
- }
-
- public short getReplicationFactor() {
- return this.replicationFactor;
- }
-
- public void setReplicationFactor(short replicationFactor) {
- this.replicationFactor = replicationFactor;
- }
-
- public int getMinPartitionCount() {
- return this.minPartitionCount;
- }
-
- public void setMinPartitionCount(int minPartitionCount) {
- this.minPartitionCount = minPartitionCount;
- }
-
- public int getHealthTimeout() {
- return this.healthTimeout;
- }
-
- public void setHealthTimeout(int healthTimeout) {
- this.healthTimeout = healthTimeout;
- }
-
- public boolean isAutoCreateTopics() {
- return this.autoCreateTopics;
- }
-
- public void setAutoCreateTopics(boolean autoCreateTopics) {
- this.autoCreateTopics = autoCreateTopics;
- }
-
- public boolean isAutoAlterTopics() {
- return autoAlterTopics;
- }
-
- public void setAutoAlterTopics(boolean autoAlterTopics) {
- this.autoAlterTopics = autoAlterTopics;
- }
-
- public boolean isAutoAddPartitions() {
- return this.autoAddPartitions;
- }
-
- public void setAutoAddPartitions(boolean autoAddPartitions) {
- this.autoAddPartitions = autoAddPartitions;
- }
-
- public Map getConfiguration() {
- return this.configuration;
- }
-
- public void setConfiguration(Map configuration) {
- this.configuration = configuration;
- }
-
- public Map getConsumerProperties() {
- return this.consumerProperties;
- }
-
- public void setConsumerProperties(Map consumerProperties) {
- Assert.notNull(consumerProperties, "'consumerProperties' cannot be null");
- this.consumerProperties = consumerProperties;
- }
-
- public Map getProducerProperties() {
- return this.producerProperties;
- }
-
- public void setProducerProperties(Map producerProperties) {
- Assert.notNull(producerProperties, "'producerProperties' cannot be null");
- this.producerProperties = producerProperties;
- }
-
- /**
- * Merge boot consumer properties, general properties from
- * {@link #setConfiguration(Map)} that apply to consumers, properties from
- * {@link #setConsumerProperties(Map)}, in that order.
- * @return the merged properties.
- */
- public Map mergedConsumerConfiguration() {
- Map consumerConfiguration = new HashMap<>();
- consumerConfiguration.putAll(this.kafkaProperties.buildConsumerProperties());
- // Copy configured binder properties that apply to consumers
- for (Map.Entry configurationEntry : this.configuration
- .entrySet()) {
- if (ConsumerConfig.configNames().contains(configurationEntry.getKey())) {
- consumerConfiguration.put(configurationEntry.getKey(),
- configurationEntry.getValue());
- }
- }
- consumerConfiguration.putAll(this.consumerProperties);
- filterStreamManagedConfiguration(consumerConfiguration);
- // Override Spring Boot bootstrap server setting if left to default with the value
- // configured in the binder
- return getConfigurationWithBootstrapServer(consumerConfiguration,
- ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG);
- }
-
- /**
- * Merge boot producer properties, general properties from
- * {@link #setConfiguration(Map)} that apply to producers, properties from
- * {@link #setProducerProperties(Map)}, in that order.
- * @return the merged properties.
- */
- public Map mergedProducerConfiguration() {
- Map producerConfiguration = new HashMap<>();
- producerConfiguration.putAll(this.kafkaProperties.buildProducerProperties());
- // Copy configured binder properties that apply to producers
- for (Map.Entry configurationEntry : this.configuration
- .entrySet()) {
- if (ProducerConfig.configNames().contains(configurationEntry.getKey())) {
- producerConfiguration.put(configurationEntry.getKey(),
- configurationEntry.getValue());
- }
- }
- producerConfiguration.putAll(this.producerProperties);
- // Override Spring Boot bootstrap server setting if left to default with the value
- // configured in the binder
- return getConfigurationWithBootstrapServer(producerConfiguration,
- ProducerConfig.BOOTSTRAP_SERVERS_CONFIG);
- }
-
- private void filterStreamManagedConfiguration(Map configuration) {
- if (configuration.containsKey(ConsumerConfig.ENABLE_AUTO_COMMIT_CONFIG)
- && configuration.get(ConsumerConfig.ENABLE_AUTO_COMMIT_CONFIG).toString().equalsIgnoreCase("true")) {
- logger.warn(constructIgnoredConfigMessage(ConsumerConfig.ENABLE_AUTO_COMMIT_CONFIG) +
- ConsumerConfig.ENABLE_AUTO_COMMIT_CONFIG + "=true is not supported by the Kafka binder");
- configuration.remove(ConsumerConfig.ENABLE_AUTO_COMMIT_CONFIG);
- }
- if (configuration.containsKey(ConsumerConfig.GROUP_ID_CONFIG)) {
- logger.warn(constructIgnoredConfigMessage(ConsumerConfig.GROUP_ID_CONFIG) +
- "Use spring.cloud.stream.default.group or spring.cloud.stream.binding..group to specify " +
- "the group instead of " + ConsumerConfig.GROUP_ID_CONFIG);
- configuration.remove(ConsumerConfig.GROUP_ID_CONFIG);
- }
- }
-
- private String constructIgnoredConfigMessage(String config) {
- return String.format("Ignoring provided value(s) for '%s'. ", config);
- }
-
- private Map getConfigurationWithBootstrapServer(
- Map configuration, String bootstrapServersConfig) {
- final String kafkaConnectionString = getKafkaConnectionString();
- if (ObjectUtils.isEmpty(configuration.get(bootstrapServersConfig)) ||
- !kafkaConnectionString.equals("localhost:9092")) {
- configuration.put(bootstrapServersConfig, kafkaConnectionString);
- }
- return Collections.unmodifiableMap(configuration);
- }
-
- public JaasLoginModuleConfiguration getJaas() {
- return this.jaas;
- }
-
- public void setJaas(JaasLoginModuleConfiguration jaas) {
- this.jaas = jaas;
- }
-
- public String getHeaderMapperBeanName() {
- return this.headerMapperBeanName;
- }
-
- public void setHeaderMapperBeanName(String headerMapperBeanName) {
- this.headerMapperBeanName = headerMapperBeanName;
- }
-
- public Duration getAuthorizationExceptionRetryInterval() {
- return authorizationExceptionRetryInterval;
- }
-
- public void setAuthorizationExceptionRetryInterval(Duration authorizationExceptionRetryInterval) {
- this.authorizationExceptionRetryInterval = authorizationExceptionRetryInterval;
- }
-
- public boolean isConsiderDownWhenAnyPartitionHasNoLeader() {
- return this.considerDownWhenAnyPartitionHasNoLeader;
- }
-
- public void setConsiderDownWhenAnyPartitionHasNoLeader(boolean considerDownWhenAnyPartitionHasNoLeader) {
- this.considerDownWhenAnyPartitionHasNoLeader = considerDownWhenAnyPartitionHasNoLeader;
- }
-
- public String getCertificateStoreDirectory() {
- return this.certificateStoreDirectory;
- }
-
- public void setCertificateStoreDirectory(String certificateStoreDirectory) {
- this.certificateStoreDirectory = certificateStoreDirectory;
- }
-
- public boolean isEnableObservation() {
- return this.enableObservation;
- }
-
- public void setEnableObservation(boolean enableObservation) {
- this.enableObservation = enableObservation;
- }
-
- /**
- * Domain class that models transaction capabilities in Kafka.
- */
- public static class Transaction {
-
- private final CombinedProducerProperties producer = new CombinedProducerProperties();
-
- private String transactionIdPrefix;
-
- public String getTransactionIdPrefix() {
- return this.transactionIdPrefix;
- }
-
- public void setTransactionIdPrefix(String transactionIdPrefix) {
- this.transactionIdPrefix = transactionIdPrefix;
- }
-
- public CombinedProducerProperties getProducer() {
- return this.producer;
- }
-
- }
-
- /**
- * An combination of {@link ProducerProperties} and {@link KafkaProducerProperties} so
- * that common and kafka-specific properties can be set for the transactional
- * producer.
- *
- * @since 2.1
- */
- public static class CombinedProducerProperties {
-
- private final ProducerProperties producerProperties = new ProducerProperties();
-
- private final KafkaProducerProperties kafkaProducerProperties = new KafkaProducerProperties();
-
- public Expression getPartitionKeyExpression() {
- return this.producerProperties.getPartitionKeyExpression();
- }
-
- public void setPartitionKeyExpression(Expression partitionKeyExpression) {
- this.producerProperties.setPartitionKeyExpression(partitionKeyExpression);
- }
-
- public boolean isPartitioned() {
- return this.producerProperties.isPartitioned();
- }
-
- public Expression getPartitionSelectorExpression() {
- return this.producerProperties.getPartitionSelectorExpression();
- }
-
- public void setPartitionSelectorExpression(
- Expression partitionSelectorExpression) {
- this.producerProperties
- .setPartitionSelectorExpression(partitionSelectorExpression);
- }
-
- public @Min(value = 1, message = "Partition count should be greater than zero.") int getPartitionCount() {
- return this.producerProperties.getPartitionCount();
- }
-
- public void setPartitionCount(int partitionCount) {
- this.producerProperties.setPartitionCount(partitionCount);
- }
-
- public String[] getRequiredGroups() {
- return this.producerProperties.getRequiredGroups();
- }
-
- public void setRequiredGroups(String... requiredGroups) {
- this.producerProperties.setRequiredGroups(requiredGroups);
- }
-
- public @AssertTrue(message = "Partition key expression and partition key extractor class properties "
- + "are mutually exclusive.") boolean isValidPartitionKeyProperty() {
- return this.producerProperties.isValidPartitionKeyProperty();
- }
-
- public @AssertTrue(message = "Partition selector class and partition selector expression "
- + "properties are mutually exclusive.") boolean isValidPartitionSelectorProperty() {
- return this.producerProperties.isValidPartitionSelectorProperty();
- }
-
- public HeaderMode getHeaderMode() {
- return this.producerProperties.getHeaderMode();
- }
-
- public void setHeaderMode(HeaderMode headerMode) {
- this.producerProperties.setHeaderMode(headerMode);
- }
-
- public boolean isUseNativeEncoding() {
- return this.producerProperties.isUseNativeEncoding();
- }
-
- public void setUseNativeEncoding(boolean useNativeEncoding) {
- this.producerProperties.setUseNativeEncoding(useNativeEncoding);
- }
-
- public boolean isErrorChannelEnabled() {
- return this.producerProperties.isErrorChannelEnabled();
- }
-
- public void setErrorChannelEnabled(boolean errorChannelEnabled) {
- this.producerProperties.setErrorChannelEnabled(errorChannelEnabled);
- }
-
- public String getPartitionKeyExtractorName() {
- return this.producerProperties.getPartitionKeyExtractorName();
- }
-
- public void setPartitionKeyExtractorName(String partitionKeyExtractorName) {
- this.producerProperties
- .setPartitionKeyExtractorName(partitionKeyExtractorName);
- }
-
- public String getPartitionSelectorName() {
- return this.producerProperties.getPartitionSelectorName();
- }
-
- public void setPartitionSelectorName(String partitionSelectorName) {
- this.producerProperties.setPartitionSelectorName(partitionSelectorName);
- }
-
- public int getBufferSize() {
- return this.kafkaProducerProperties.getBufferSize();
- }
-
- public void setBufferSize(int bufferSize) {
- this.kafkaProducerProperties.setBufferSize(bufferSize);
- }
-
- public @NotNull CompressionType getCompressionType() {
- return this.kafkaProducerProperties.getCompressionType();
- }
-
- public void setCompressionType(CompressionType compressionType) {
- this.kafkaProducerProperties.setCompressionType(compressionType);
- }
-
- public boolean isSync() {
- return this.kafkaProducerProperties.isSync();
- }
-
- public void setSync(boolean sync) {
- this.kafkaProducerProperties.setSync(sync);
- }
-
- public int getBatchTimeout() {
- return this.kafkaProducerProperties.getBatchTimeout();
- }
-
- public void setBatchTimeout(int batchTimeout) {
- this.kafkaProducerProperties.setBatchTimeout(batchTimeout);
- }
-
- public Expression getMessageKeyExpression() {
- return this.kafkaProducerProperties.getMessageKeyExpression();
- }
-
- public void setMessageKeyExpression(Expression messageKeyExpression) {
- this.kafkaProducerProperties.setMessageKeyExpression(messageKeyExpression);
- }
-
- public String[] getHeaderPatterns() {
- return this.kafkaProducerProperties.getHeaderPatterns();
- }
-
- public void setHeaderPatterns(String[] headerPatterns) {
- this.kafkaProducerProperties.setHeaderPatterns(headerPatterns);
- }
-
- public Map getConfiguration() {
- return this.kafkaProducerProperties.getConfiguration();
- }
-
- public void setConfiguration(Map configuration) {
- this.kafkaProducerProperties.setConfiguration(configuration);
- }
-
- public KafkaTopicProperties getTopic() {
- return this.kafkaProducerProperties.getTopic();
- }
-
- public void setTopic(KafkaTopicProperties topic) {
- this.kafkaProducerProperties.setTopic(topic);
- }
-
- public KafkaProducerProperties getExtension() {
- return this.kafkaProducerProperties;
- }
-
- }
-
- public static class Metrics {
- /**
- * When set to true, the offset lag metric of each consumer topic is computed whenever the metric is queried (default: true).
- * When set to false only the periodically calculated offset lag is used.
- * See {@link #offsetLagMetricsInterval} for more information.
- */
- private boolean defaultOffsetLagMetricsEnabled = true;
-
- /**
- * The interval in which the offset lag for each consumer topic is computed (default: 60 seconds).
- * This value is used whenever {@link #defaultOffsetLagMetricsEnabled} is disabled or its computation is taking too long.
- */
- private Duration offsetLagMetricsInterval = Duration.ofSeconds(60);
-
- public boolean isDefaultOffsetLagMetricsEnabled() {
- return defaultOffsetLagMetricsEnabled;
- }
-
- public void setDefaultOffsetLagMetricsEnabled(boolean defaultOffsetLagMetricsEnabled) {
- this.defaultOffsetLagMetricsEnabled = defaultOffsetLagMetricsEnabled;
- }
-
- public Duration getOffsetLagMetricsInterval() {
- return offsetLagMetricsInterval;
- }
-
- public void setOffsetLagMetricsInterval(Duration offsetLagMetricsInterval) {
- this.offsetLagMetricsInterval = offsetLagMetricsInterval;
- }
- }
-}
diff --git a/binders/kafka-binder/spring-cloud-stream-binder-kafka-core/src/main/java/org/springframework/cloud/stream/binder/kafka/properties/KafkaBindingProperties.java b/binders/kafka-binder/spring-cloud-stream-binder-kafka-core/src/main/java/org/springframework/cloud/stream/binder/kafka/properties/KafkaBindingProperties.java
deleted file mode 100644
index e84b0b2c7..000000000
--- a/binders/kafka-binder/spring-cloud-stream-binder-kafka-core/src/main/java/org/springframework/cloud/stream/binder/kafka/properties/KafkaBindingProperties.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Copyright 2016-2018 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.cloud.stream.binder.kafka.properties;
-
-import org.springframework.cloud.stream.binder.BinderSpecificPropertiesProvider;
-
-/**
- * Container object for Kafka specific extended producer and consumer binding properties.
- *
- * @author Marius Bogoevici
- * @author Oleg Zhurakousky
- */
-public class KafkaBindingProperties implements BinderSpecificPropertiesProvider {
-
- /**
- * Consumer specific binding properties. @see {@link KafkaConsumerProperties}.
- */
- private KafkaConsumerProperties consumer = new KafkaConsumerProperties();
-
- /**
- * Producer specific binding properties. @see {@link KafkaProducerProperties}.
- */
- private KafkaProducerProperties producer = new KafkaProducerProperties();
-
- /**
- * @return {@link KafkaConsumerProperties}
- * Consumer specific binding properties. @see {@link KafkaConsumerProperties}.
- */
- public KafkaConsumerProperties getConsumer() {
- return this.consumer;
- }
-
- public void setConsumer(KafkaConsumerProperties consumer) {
- this.consumer = consumer;
- }
-
- /**
- * @return {@link KafkaProducerProperties}
- * Producer specific binding properties. @see {@link KafkaProducerProperties}.
- */
- public KafkaProducerProperties getProducer() {
- return this.producer;
- }
-
- public void setProducer(KafkaProducerProperties producer) {
- this.producer = producer;
- }
-
-}
diff --git a/binders/kafka-binder/spring-cloud-stream-binder-kafka-core/src/main/java/org/springframework/cloud/stream/binder/kafka/properties/KafkaConsumerProperties.java b/binders/kafka-binder/spring-cloud-stream-binder-kafka-core/src/main/java/org/springframework/cloud/stream/binder/kafka/properties/KafkaConsumerProperties.java
deleted file mode 100644
index d6f6205bc..000000000
--- a/binders/kafka-binder/spring-cloud-stream-binder-kafka-core/src/main/java/org/springframework/cloud/stream/binder/kafka/properties/KafkaConsumerProperties.java
+++ /dev/null
@@ -1,576 +0,0 @@
-/*
- * Copyright 2016-2023 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.cloud.stream.binder.kafka.properties;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.springframework.kafka.listener.ContainerProperties;
-
-/**
- * Extended consumer properties for Kafka binder.
- *
- * @author Marius Bogoevici
- * @author Ilayaperumal Gopinathan
- * @author Soby Chacko
- * @author Gary Russell
- * @author Aldo Sinanaj
- *
- *
- * Thanks to Laszlo Szabo for providing the initial patch for generic property support.
- *
- */
-public class KafkaConsumerProperties {
-
- /**
- * Enumeration for starting consumer offset.
- */
- public enum StartOffset {
-
- /**
- * Starting from earliest offset.
- */
- earliest(-2L),
- /**
- * Starting from latest offset.
- */
- latest(-1L);
-
- private final long referencePoint;
-
- StartOffset(long referencePoint) {
- this.referencePoint = referencePoint;
- }
-
- public long getReferencePoint() {
- return this.referencePoint;
- }
-
- }
-
- /**
- * Standard headers for the message.
- */
- public enum StandardHeaders {
-
- /**
- * No headers.
- */
- none,
- /**
- * Message header representing ID.
- */
- id,
- /**
- * Message header representing timestamp.
- */
- timestamp,
- /**
- * Indicating both ID and timestamp headers.
- */
- both
-
- }
-
- /**
- * When true the offset is committed after each record, otherwise the offsets for the complete set of records
- * received from the poll() are committed after all records have been processed.
- */
- @Deprecated
- private boolean ackEachRecord;
-
- /**
- * When true, topic partitions is automatically rebalanced between the members of a consumer group.
- * When false, each consumer is assigned a fixed set of partitions based on spring.cloud.stream.instanceCount and spring.cloud.stream.instanceIndex.
- */
- private boolean autoRebalanceEnabled = true;
-
- /**
- * Whether to autocommit offsets when a message has been processed.
- * If set to false, a header with the key kafka_acknowledgment of the type org.springframework.kafka.support.Acknowledgment header
- * is present in the inbound message. Applications may use this header for acknowledging messages.
- */
- @Deprecated
- private boolean autoCommitOffset = true;
-
- /**
- * Controlling the container acknowledgement mode. This is the preferred way to control the ack mode on the
- * container instead of the deprecated autoCommitOffset property.
- */
- private ContainerProperties.AckMode ackMode;
-
- /**
- * Flag to enable auto commit on error in polled consumers.
- */
- private Boolean autoCommitOnError;
-
- /**
- * The starting offset for new groups. Allowed values: earliest and latest.
- */
- private StartOffset startOffset;
-
- /**
- * Whether to reset offsets on the consumer to the value provided by startOffset.
- * Must be false if a KafkaRebalanceListener is provided.
- */
- private boolean resetOffsets;
-
- /**
- * When set to true, it enables DLQ behavior for the consumer.
- * By default, messages that result in errors are forwarded to a topic named error.name-of-destination.name-of-group.
- * The DLQ topic name can be configurable by setting the dlqName property.
- */
- private boolean enableDlq;
-
- /**
- * The name of the DLQ topic to receive the error messages.
- */
- private String dlqName;
-
- /**
- * Number of partitions to use on the DLQ.
- */
- private Integer dlqPartitions;
-
- /**
- * Using this, DLQ-specific producer properties can be set.
- * All the properties available through kafka producer properties can be set through this property.
- */
- private KafkaProducerProperties dlqProducerProperties = new KafkaProducerProperties();
-
- /**
- * @deprecated No longer used by the binder.
- */
- @Deprecated
- private int recoveryInterval = 5000;
-
- /**
- * List of trusted packages to provide the header mapper.
- */
- private String[] trustedPackages;
-
- /**
- * Indicates which standard headers are populated by the inbound channel adapter.
- * Allowed values: none, id, timestamp, or both.
- */
- private StandardHeaders standardHeaders = StandardHeaders.none;
-
- /**
- * The name of a bean that implements RecordMessageConverter.
- */
- private String converterBeanName;
-
- /**
- * The interval, in milliseconds, between events indicating that no messages have recently been received.
- */
- private long idleEventInterval = 30_000;
-
- /**
- * When true, the destination is treated as a regular expression Pattern used to match topic names by the broker.
- */
- private boolean destinationIsPattern;
-
- /**
- * Map with a key/value pair containing generic Kafka consumer properties.
- * In addition to having Kafka consumer properties, other configuration properties can be passed here.
- */
- private Map configuration = new HashMap<>();
-
- /**
- * Various topic level properties. @see {@link KafkaTopicProperties} for more details.
- */
- private KafkaTopicProperties topic = new KafkaTopicProperties();
-
- /**
- * Timeout used for polling in pollable consumers.
- */
- private long pollTimeout = org.springframework.kafka.listener.ConsumerProperties.DEFAULT_POLL_TIMEOUT;
-
- /**
- * Transaction manager bean name - overrides the binder's transaction configuration.
- */
- private String transactionManager;
-
- /**
- * Set to false to NOT commit the offset of a successfully recovered recovered in the after rollback processor.
- */
- private boolean txCommitRecovered = true;
-
- /**
- * CommonErrorHandler bean name per consumer binding.
- * @since 3.2
- */
- private String commonErrorHandlerBeanName;
-
- /**
- * When using the reactive binder, automatically commit offsets when records received
- * by the poll have been processed.
- * @since 4.0.2
- */
- private boolean reactiveAutoCommit;
-
- /**
- * When using the reactive binder, automatically commit offsets of records before they
- * are passed to the user code.
- * @since 4.0.3
- */
- private boolean reactiveAtMostOnce;
-
- /**
- * @return if each record needs to be acknowledged.
- *
- * When true the offset is committed after each record, otherwise the offsets for the complete set of records
- * received from the poll() are committed after all records have been processed.
- *
- * @deprecated since 3.1 in favor of using {@link #ackMode}
- */
- @Deprecated
- public boolean isAckEachRecord() {
- return this.ackEachRecord;
- }
-
- /**
- * @param ackEachRecord
- *
- * @deprecated in favor of using {@link #ackMode}
- */
- @Deprecated
- public void setAckEachRecord(boolean ackEachRecord) {
- this.ackEachRecord = ackEachRecord;
- }
-
- /**
- * @return is autocommit offset enabled
- *
- * Whether to autocommit offsets when a message has been processed.
- * If set to false, a header with the key kafka_acknowledgment of the type org.springframework.kafka.support.Acknowledgment header
- * is present in the inbound message. Applications may use this header for acknowledging messages.
- *
- * @deprecated since 3.1 in favor of using {@link #ackMode}
- */
- @Deprecated
- public boolean isAutoCommitOffset() {
- return this.autoCommitOffset;
- }
-
- /**
- * @param autoCommitOffset
- *
- * @deprecated in favor of using {@link #ackMode}
- */
- @Deprecated
- public void setAutoCommitOffset(boolean autoCommitOffset) {
- this.autoCommitOffset = autoCommitOffset;
- }
-
- /**
- * @return Container's ack mode.
- */
- public ContainerProperties.AckMode getAckMode() {
- return this.ackMode;
- }
-
- public void setAckMode(ContainerProperties.AckMode ackMode) {
- this.ackMode = ackMode;
- }
-
- /**
- * @return start offset
- *
- * The starting offset for new groups. Allowed values: earliest and latest.
- */
- public StartOffset getStartOffset() {
- return this.startOffset;
- }
-
- public void setStartOffset(StartOffset startOffset) {
- this.startOffset = startOffset;
- }
-
- /**
- * @return if resetting offset is enabled
- *
- * Whether to reset offsets on the consumer to the value provided by startOffset.
- * Must be false if a KafkaRebalanceListener is provided.
- */
- public boolean isResetOffsets() {
- return this.resetOffsets;
- }
-
- public void setResetOffsets(boolean resetOffsets) {
- this.resetOffsets = resetOffsets;
- }
-
- /**
- * @return is DLQ enabled.
- *
- * When set to true, it enables DLQ behavior for the consumer.
- * By default, messages that result in errors are forwarded to a topic named error.name-of-destination.name-of-group.
- * The DLQ topic name can be configurable by setting the dlqName property.
- */
- public boolean isEnableDlq() {
- return this.enableDlq;
- }
-
- public void setEnableDlq(boolean enableDlq) {
- this.enableDlq = enableDlq;
- }
-
- /**
- * @return is autocommit on error in polled consumers.
- *
- * This property accessor is only used in polled consumers.
- */
- public Boolean getAutoCommitOnError() {
- return this.autoCommitOnError;
- }
-
- /**
- *
- * @param autoCommitOnError commit on error in polled consumers.
- *
- */
- public void setAutoCommitOnError(Boolean autoCommitOnError) {
- this.autoCommitOnError = autoCommitOnError;
- }
-
- /**
- * No longer used.
- * @return the interval.
- * @deprecated No longer used by the binder
- */
- @Deprecated
- public int getRecoveryInterval() {
- return this.recoveryInterval;
- }
-
- /**
- * No longer used.
- * @param recoveryInterval the interval.
- * @deprecated No longer needed by the binder
- */
- @Deprecated
- public void setRecoveryInterval(int recoveryInterval) {
- this.recoveryInterval = recoveryInterval;
- }
-
- /**
- * @return is auto rebalance enabled
- *
- * When true, topic partitions is automatically rebalanced between the members of a consumer group.
- * When false, each consumer is assigned a fixed set of partitions based on spring.cloud.stream.instanceCount and spring.cloud.stream.instanceIndex.
- */
- public boolean isAutoRebalanceEnabled() {
- return this.autoRebalanceEnabled;
- }
-
- public void setAutoRebalanceEnabled(boolean autoRebalanceEnabled) {
- this.autoRebalanceEnabled = autoRebalanceEnabled;
- }
-
- /**
- * @return a map of configuration
- *
- * Map with a key/value pair containing generic Kafka consumer properties.
- * In addition to having Kafka consumer properties, other configuration properties can be passed here.
- */
- public Map getConfiguration() {
- return this.configuration;
- }
-
- public void setConfiguration(Map configuration) {
- this.configuration = configuration;
- }
-
- /**
- * @return dlq name
- *
- * The name of the DLQ topic to receive the error messages.
- */
- public String getDlqName() {
- return this.dlqName;
- }
-
- public void setDlqName(String dlqName) {
- this.dlqName = dlqName;
- }
-
- /**
- * @return number of partitions on the DLQ topic
- *
- * Number of partitions to use on the DLQ.
- */
- public Integer getDlqPartitions() {
- return this.dlqPartitions;
- }
-
- public void setDlqPartitions(Integer dlqPartitions) {
- this.dlqPartitions = dlqPartitions;
- }
-
- /**
- * @return trusted packages
- *
- * List of trusted packages to provide the header mapper.
- */
- public String[] getTrustedPackages() {
- return this.trustedPackages;
- }
-
- public void setTrustedPackages(String[] trustedPackages) {
- this.trustedPackages = trustedPackages;
- }
-
- /**
- * @return dlq producer properties
- *
- * Using this, DLQ-specific producer properties can be set.
- * All the properties available through kafka producer properties can be set through this property.
- */
- public KafkaProducerProperties getDlqProducerProperties() {
- return this.dlqProducerProperties;
- }
-
- public void setDlqProducerProperties(KafkaProducerProperties dlqProducerProperties) {
- this.dlqProducerProperties = dlqProducerProperties;
- }
-
- /**
- * @return standard headers
- *
- * Indicates which standard headers are populated by the inbound channel adapter.
- * Allowed values: none, id, timestamp, or both.
- */
- public StandardHeaders getStandardHeaders() {
- return this.standardHeaders;
- }
-
- public void setStandardHeaders(StandardHeaders standardHeaders) {
- this.standardHeaders = standardHeaders;
- }
-
- /**
- * @return converter bean name
- *
- * The name of a bean that implements RecordMessageConverter.
- */
- public String getConverterBeanName() {
- return this.converterBeanName;
- }
-
- public void setConverterBeanName(String converterBeanName) {
- this.converterBeanName = converterBeanName;
- }
-
- /**
- * @return idle event interval
- *
- * The interval, in milliseconds, between events indicating that no messages have recently been received.
- */
- public long getIdleEventInterval() {
- return this.idleEventInterval;
- }
-
- public void setIdleEventInterval(long idleEventInterval) {
- this.idleEventInterval = idleEventInterval;
- }
-
- /**
- * @return is destination given through a pattern
- *
- * When true, the destination is treated as a regular expression Pattern used to match topic names by the broker.
- */
- public boolean isDestinationIsPattern() {
- return this.destinationIsPattern;
- }
-
- public void setDestinationIsPattern(boolean destinationIsPattern) {
- this.destinationIsPattern = destinationIsPattern;
- }
-
- /**
- * @return topic properties
- *
- * Various topic level properties. @see {@link KafkaTopicProperties} for more details.
- */
- public KafkaTopicProperties getTopic() {
- return this.topic;
- }
-
- public void setTopic(KafkaTopicProperties topic) {
- this.topic = topic;
- }
-
- /**
- * @return timeout in pollable consumers
- *
- * Timeout used for polling in pollable consumers.
- */
- public long getPollTimeout() {
- return this.pollTimeout;
- }
-
- public void setPollTimeout(long pollTimeout) {
- this.pollTimeout = pollTimeout;
- }
-
- /**
- * @return the transaction manager bean name.
- *
- * Transaction manager bean name (must be {@code KafkaAwareTransactionManager}.
- */
- public String getTransactionManager() {
- return this.transactionManager;
- }
-
- public void setTransactionManager(String transactionManager) {
- this.transactionManager = transactionManager;
- }
-
- public boolean isTxCommitRecovered() {
- return this.txCommitRecovered;
- }
-
- public void setTxCommitRecovered(boolean txCommitRecovered) {
- this.txCommitRecovered = txCommitRecovered;
- }
-
- public String getCommonErrorHandlerBeanName() {
- return commonErrorHandlerBeanName;
- }
-
- public void setCommonErrorHandlerBeanName(String commonErrorHandlerBeanName) {
- this.commonErrorHandlerBeanName = commonErrorHandlerBeanName;
- }
-
- public boolean isReactiveAutoCommit() {
- return this.reactiveAutoCommit;
- }
-
- public void setReactiveAutoCommit(boolean reactiveAutoCommit) {
- this.reactiveAutoCommit = reactiveAutoCommit;
- }
-
- public boolean isReactiveAtMostOnce() {
- return this.reactiveAtMostOnce;
- }
-
- public void setReactiveAtMostOnce(boolean reactiveAtMostOnce) {
- this.reactiveAtMostOnce = reactiveAtMostOnce;
- }
-
-}
diff --git a/binders/kafka-binder/spring-cloud-stream-binder-kafka-core/src/main/java/org/springframework/cloud/stream/binder/kafka/properties/KafkaExtendedBindingProperties.java b/binders/kafka-binder/spring-cloud-stream-binder-kafka-core/src/main/java/org/springframework/cloud/stream/binder/kafka/properties/KafkaExtendedBindingProperties.java
deleted file mode 100644
index 99357cc2a..000000000
--- a/binders/kafka-binder/spring-cloud-stream-binder-kafka-core/src/main/java/org/springframework/cloud/stream/binder/kafka/properties/KafkaExtendedBindingProperties.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright 2016-2018 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.cloud.stream.binder.kafka.properties;
-
-import java.util.Map;
-
-import org.springframework.boot.context.properties.ConfigurationProperties;
-import org.springframework.cloud.stream.binder.AbstractExtendedBindingProperties;
-import org.springframework.cloud.stream.binder.BinderSpecificPropertiesProvider;
-
-/**
- * Kafka specific extended binding properties class that extends from
- * {@link AbstractExtendedBindingProperties}.
- *
- * @author Marius Bogoevici
- * @author Gary Russell
- * @author Soby Chacko
- * @author Oleg Zhurakousky
- */
-@ConfigurationProperties("spring.cloud.stream.kafka")
-public class KafkaExtendedBindingProperties extends
- AbstractExtendedBindingProperties {
-
- private static final String DEFAULTS_PREFIX = "spring.cloud.stream.kafka.default";
-
- @Override
- public String getDefaultsPrefix() {
- return DEFAULTS_PREFIX;
- }
-
- @Override
- public Map getBindings() {
- return this.doGetBindings();
- }
-
- @Override
- public Class extends BinderSpecificPropertiesProvider> getExtendedPropertiesEntryClass() {
- return KafkaBindingProperties.class;
- }
-
-}
diff --git a/binders/kafka-binder/spring-cloud-stream-binder-kafka-core/src/main/java/org/springframework/cloud/stream/binder/kafka/properties/KafkaProducerProperties.java b/binders/kafka-binder/spring-cloud-stream-binder-kafka-core/src/main/java/org/springframework/cloud/stream/binder/kafka/properties/KafkaProducerProperties.java
deleted file mode 100644
index a64d08dda..000000000
--- a/binders/kafka-binder/spring-cloud-stream-binder-kafka-core/src/main/java/org/springframework/cloud/stream/binder/kafka/properties/KafkaProducerProperties.java
+++ /dev/null
@@ -1,328 +0,0 @@
-/*
- * Copyright 2016-2018 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.cloud.stream.binder.kafka.properties;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import jakarta.validation.constraints.NotNull;
-
-import org.springframework.expression.Expression;
-
-/**
- * Extended producer properties for Kafka binder.
- *
- * @author Marius Bogoevici
- * @author Henryk Konsek
- * @author Gary Russell
- * @author Aldo Sinanaj
- */
-public class KafkaProducerProperties {
-
- /**
- * Upper limit, in bytes, of how much data the Kafka producer attempts to batch before sending.
- */
- private int bufferSize = 16384;
-
- /**
- * Set the compression.type producer property. Supported values are none, gzip, snappy and lz4.
- * See {@link CompressionType} for more details.
- */
- private CompressionType compressionType = CompressionType.none;
-
- /**
- * Whether the producer is synchronous.
- */
- private boolean sync;
-
- /**
- * A SpEL expression evaluated against the outgoing message used to evaluate the time to wait
- * for ack when synchronous publish is enabled.
- */
- private Expression sendTimeoutExpression;
-
- /**
- * How long the producer waits to allow more messages to accumulate in the same batch before sending the messages.
- */
- private int batchTimeout;
-
- /**
- * A SpEL expression evaluated against the outgoing message used to populate the key of the produced Kafka message.
- */
- private Expression messageKeyExpression;
-
- /**
- * A comma-delimited list of simple patterns to match Spring messaging headers
- * to be mapped to the Kafka Headers in the ProducerRecord.
- */
- private String[] headerPatterns;
-
- /**
- * Map with a key/value pair containing generic Kafka producer properties.
- */
- private Map configuration = new HashMap<>();
-
- /**
- * Various topic level properties. @see {@link KafkaTopicProperties} for more details.
- */
- private KafkaTopicProperties topic = new KafkaTopicProperties();
-
- /**
- * Set to true to override the default binding destination (topic name) with the value of the
- * KafkaHeaders.TOPIC message header in the outbound message. If the header is not present,
- * the default binding destination is used.
- */
- private boolean useTopicHeader;
-
- /**
- * The bean name of a MessageChannel to which successful send results should be sent;
- * the bean must exist in the application context. When using the reactive binder,
- * the channel must be of type FluxMessageChannel.
- */
- private String recordMetadataChannel;
-
- /**
- * Transaction manager bean name - overrides the binder's transaction configuration.
- */
- private String transactionManager;
-
- /*
- * Timeout value in seconds for the duration to wait when closing the producer.
- * If not set this defaults to 30 seconds.
- */
- private int closeTimeout;
-
- /**
- * Set to true to disable transactions.
- */
- private boolean allowNonTransactional;
-
- /**
- * @return buffer size
- *
- * Upper limit, in bytes, of how much data the Kafka producer attempts to batch before sending.
- */
- public int getBufferSize() {
- return this.bufferSize;
- }
-
- public void setBufferSize(int bufferSize) {
- this.bufferSize = bufferSize;
- }
-
- /**
- * @return compression type {@link CompressionType}
- *
- * Set the compression.type producer property. Supported values are none, gzip, snappy, lz4 and zstd.
- * See {@link CompressionType} for more details.
- */
- @NotNull
- public CompressionType getCompressionType() {
- return this.compressionType;
- }
-
- public void setCompressionType(CompressionType compressionType) {
- this.compressionType = compressionType;
- }
-
- /**
- * @return if synchronous sending is enabled
- *
- * Whether the producer is synchronous.
- */
- public boolean isSync() {
- return this.sync;
- }
-
- public void setSync(boolean sync) {
- this.sync = sync;
- }
-
- /**
- * @return timeout expression for send
- *
- * A SpEL expression evaluated against the outgoing message used to evaluate the time to wait
- * for ack when synchronous publish is enabled.
- */
- public Expression getSendTimeoutExpression() {
- return this.sendTimeoutExpression;
- }
-
- public void setSendTimeoutExpression(Expression sendTimeoutExpression) {
- this.sendTimeoutExpression = sendTimeoutExpression;
- }
-
- /**
- * @return batch timeout
- *
- * How long the producer waits to allow more messages to accumulate in the same batch before sending the messages.
- */
- public int getBatchTimeout() {
- return this.batchTimeout;
- }
-
- public void setBatchTimeout(int batchTimeout) {
- this.batchTimeout = batchTimeout;
- }
-
- /**
- * @return message key expression
- *
- * A SpEL expression evaluated against the outgoing message used to populate the key of the produced Kafka message.
- */
- public Expression getMessageKeyExpression() {
- return this.messageKeyExpression;
- }
-
- public void setMessageKeyExpression(Expression messageKeyExpression) {
- this.messageKeyExpression = messageKeyExpression;
- }
-
- /**
- * @return header patterns
- *
- * A comma-delimited list of simple patterns to match Spring messaging headers
- * to be mapped to the Kafka Headers in the ProducerRecord.
- */
- public String[] getHeaderPatterns() {
- return this.headerPatterns;
- }
-
- public void setHeaderPatterns(String[] headerPatterns) {
- this.headerPatterns = headerPatterns;
- }
-
- /**
- * @return map of configuration
- *
- * Map with a key/value pair containing generic Kafka producer properties.
- */
- public Map getConfiguration() {
- return this.configuration;
- }
-
- public void setConfiguration(Map configuration) {
- this.configuration = configuration;
- }
-
- /**
- * @return topic properties
- *
- * Various topic level properties. @see {@link KafkaTopicProperties} for more details.
- */
- public KafkaTopicProperties getTopic() {
- return this.topic;
- }
-
- public void setTopic(KafkaTopicProperties topic) {
- this.topic = topic;
- }
-
- /**
- * @return if using topic header
- *
- * Set to true to override the default binding destination (topic name) with the value of the
- * KafkaHeaders.TOPIC message header in the outbound message. If the header is not present,
- * the default binding destination is used.
- */
- public boolean isUseTopicHeader() {
- return this.useTopicHeader;
- }
-
- public void setUseTopicHeader(boolean useTopicHeader) {
- this.useTopicHeader = useTopicHeader;
- }
-
- /**
- * @return record metadata channel
- *
- * The bean name of a MessageChannel to which successful send results should be sent;
- * the bean must exist in the application context.
- */
- public String getRecordMetadataChannel() {
- return this.recordMetadataChannel;
- }
-
- public void setRecordMetadataChannel(String recordMetadataChannel) {
- this.recordMetadataChannel = recordMetadataChannel;
- }
-
- /**
- * @return the transaction manager bean name.
- *
- * Transaction manager bean name (must be {@code KafkaAwareTransactionManager}.
- */
- public String getTransactionManager() {
- return this.transactionManager;
- }
-
- public void setTransactionManager(String transactionManager) {
- this.transactionManager = transactionManager;
- }
-
- /*
- * @return timeout in seconds for closing the producer
- */
- public int getCloseTimeout() {
- return this.closeTimeout;
- }
-
- public void setCloseTimeout(int closeTimeout) {
- this.closeTimeout = closeTimeout;
- }
-
- public boolean isAllowNonTransactional() {
- return this.allowNonTransactional;
- }
-
- public void setAllowNonTransactional(boolean allowNonTransactional) {
- this.allowNonTransactional = allowNonTransactional;
- }
-
- /**
- * Enumeration for compression types.
- */
- public enum CompressionType {
-
- /**
- * No compression.
- */
- none,
-
- /**
- * gzip based compression.
- */
- gzip,
-
- /**
- * snappy based compression.
- */
- snappy,
-
- /**
- * lz4 compression.
- */
- lz4,
-
- /**
- * zstd compression.
- */
- zstd,
-
- }
-
-}
diff --git a/binders/kafka-binder/spring-cloud-stream-binder-kafka-core/src/main/java/org/springframework/cloud/stream/binder/kafka/properties/KafkaTopicProperties.java b/binders/kafka-binder/spring-cloud-stream-binder-kafka-core/src/main/java/org/springframework/cloud/stream/binder/kafka/properties/KafkaTopicProperties.java
deleted file mode 100644
index e9a1425b7..000000000
--- a/binders/kafka-binder/spring-cloud-stream-binder-kafka-core/src/main/java/org/springframework/cloud/stream/binder/kafka/properties/KafkaTopicProperties.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Copyright 2019-2019 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.cloud.stream.binder.kafka.properties;
-
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-/**
- * Properties for configuring topics.
- *
- * @author Aldo Sinanaj
- * @since 2.2
- *
- */
-public class KafkaTopicProperties {
-
- private Short replicationFactor;
-
- private Map> replicasAssignments = new HashMap<>();
-
- private Map properties = new HashMap<>();
-
- public Short getReplicationFactor() {
- return replicationFactor;
- }
-
- public void setReplicationFactor(Short replicationFactor) {
- this.replicationFactor = replicationFactor;
- }
-
- public Map> getReplicasAssignments() {
- return replicasAssignments;
- }
-
- public void setReplicasAssignments(Map> replicasAssignments) {
- this.replicasAssignments = replicasAssignments;
- }
-
- public Map getProperties() {
- return properties;
- }
-
- public void setProperties(Map properties) {
- this.properties = properties;
- }
-
-}
diff --git a/binders/kafka-binder/spring-cloud-stream-binder-kafka-core/src/main/java/org/springframework/cloud/stream/binder/kafka/provisioning/AdminClientConfigCustomizer.java b/binders/kafka-binder/spring-cloud-stream-binder-kafka-core/src/main/java/org/springframework/cloud/stream/binder/kafka/provisioning/AdminClientConfigCustomizer.java
deleted file mode 100644
index 25b2fe79e..000000000
--- a/binders/kafka-binder/spring-cloud-stream-binder-kafka-core/src/main/java/org/springframework/cloud/stream/binder/kafka/provisioning/AdminClientConfigCustomizer.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Copyright 2021-2021 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.cloud.stream.binder.kafka.provisioning;
-
-import java.util.Map;
-
-/**
- * Customizer for configuring AdminClient.
- *
- * @author Soby Chacko
- * @since 3.1.2
- */
-@FunctionalInterface
-public interface AdminClientConfigCustomizer {
-
- void configure(Map adminClientProperties);
-}
diff --git a/binders/kafka-binder/spring-cloud-stream-binder-kafka-core/src/main/java/org/springframework/cloud/stream/binder/kafka/provisioning/KafkaTopicProvisioner.java b/binders/kafka-binder/spring-cloud-stream-binder-kafka-core/src/main/java/org/springframework/cloud/stream/binder/kafka/provisioning/KafkaTopicProvisioner.java
deleted file mode 100644
index f9e823e9f..000000000
--- a/binders/kafka-binder/spring-cloud-stream-binder-kafka-core/src/main/java/org/springframework/cloud/stream/binder/kafka/provisioning/KafkaTopicProvisioner.java
+++ /dev/null
@@ -1,690 +0,0 @@
-/*
- * Copyright 2014-2023 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.cloud.stream.binder.kafka.provisioning;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.concurrent.Callable;
-import java.util.concurrent.ExecutionException;
-import java.util.concurrent.TimeUnit;
-import java.util.stream.Collectors;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.kafka.clients.CommonClientConfigs;
-import org.apache.kafka.clients.admin.AdminClient;
-import org.apache.kafka.clients.admin.AdminClientConfig;
-import org.apache.kafka.clients.admin.AlterConfigOp;
-import org.apache.kafka.clients.admin.AlterConfigsResult;
-import org.apache.kafka.clients.admin.Config;
-import org.apache.kafka.clients.admin.ConfigEntry;
-import org.apache.kafka.clients.admin.CreatePartitionsResult;
-import org.apache.kafka.clients.admin.CreateTopicsResult;
-import org.apache.kafka.clients.admin.DescribeConfigsResult;
-import org.apache.kafka.clients.admin.DescribeTopicsResult;
-import org.apache.kafka.clients.admin.ListTopicsResult;
-import org.apache.kafka.clients.admin.NewPartitions;
-import org.apache.kafka.clients.admin.NewTopic;
-import org.apache.kafka.clients.admin.TopicDescription;
-import org.apache.kafka.common.KafkaFuture;
-import org.apache.kafka.common.PartitionInfo;
-import org.apache.kafka.common.config.ConfigResource;
-import org.apache.kafka.common.errors.TopicExistsException;
-import org.apache.kafka.common.errors.UnknownTopicOrPartitionException;
-
-import org.springframework.beans.factory.InitializingBean;
-import org.springframework.boot.autoconfigure.kafka.KafkaProperties;
-import org.springframework.cloud.stream.binder.BinderException;
-import org.springframework.cloud.stream.binder.ExtendedConsumerProperties;
-import org.springframework.cloud.stream.binder.ExtendedProducerProperties;
-import org.springframework.cloud.stream.binder.kafka.properties.KafkaBinderConfigurationProperties;
-import org.springframework.cloud.stream.binder.kafka.properties.KafkaConsumerProperties;
-import org.springframework.cloud.stream.binder.kafka.properties.KafkaProducerProperties;
-import org.springframework.cloud.stream.binder.kafka.properties.KafkaTopicProperties;
-import org.springframework.cloud.stream.binder.kafka.utils.KafkaTopicUtils;
-import org.springframework.cloud.stream.provisioning.ConsumerDestination;
-import org.springframework.cloud.stream.provisioning.ProducerDestination;
-import org.springframework.cloud.stream.provisioning.ProvisioningException;
-import org.springframework.cloud.stream.provisioning.ProvisioningProvider;
-import org.springframework.retry.RetryOperations;
-import org.springframework.retry.backoff.ExponentialBackOffPolicy;
-import org.springframework.retry.policy.SimpleRetryPolicy;
-import org.springframework.retry.support.RetryTemplate;
-import org.springframework.util.Assert;
-import org.springframework.util.CollectionUtils;
-import org.springframework.util.ObjectUtils;
-import org.springframework.util.StringUtils;
-
-/**
- * Kafka implementation for {@link ProvisioningProvider}.
- *
- * @author Soby Chacko
- * @author Gary Russell
- * @author Ilayaperumal Gopinathan
- * @author Simon Flandergan
- * @author Oleg Zhurakousky
- * @author Aldo Sinanaj
- * @author Yi Liu
- * @author Omer Celik
- * @author Byungjun You
- */
-public class KafkaTopicProvisioner implements
- // @checkstyle:off
- ProvisioningProvider, ExtendedProducerProperties>,
- // @checkstyle:on
- InitializingBean {
-
- private static final Log logger = LogFactory.getLog(KafkaTopicProvisioner.class);
-
- private static final int DEFAULT_OPERATION_TIMEOUT = 30;
-
- private final KafkaBinderConfigurationProperties configurationProperties;
-
- private final int operationTimeout = DEFAULT_OPERATION_TIMEOUT;
-
- private final Map adminClientProperties;
-
- private RetryOperations metadataRetryOperations;
-
- /**
- * Create an instance.
- * @param kafkaBinderConfigurationProperties the binder configuration properties.
- * @param kafkaProperties the boot Kafka properties used to build the
- * @param adminClientConfigCustomizer to customize {@link AdminClient}.
- * {@link AdminClient}.
- */
- public KafkaTopicProvisioner(
- KafkaBinderConfigurationProperties kafkaBinderConfigurationProperties,
- KafkaProperties kafkaProperties,
- AdminClientConfigCustomizer adminClientConfigCustomizer) {
- this(kafkaBinderConfigurationProperties, kafkaProperties, adminClientConfigCustomizer != null ?
- Arrays.asList(adminClientConfigCustomizer) : new ArrayList<>());
- }
-
- /**
- * Create an instance.
- *
- * @param kafkaBinderConfigurationProperties the binder configuration properties.
- * @param kafkaProperties the boot Kafka properties used to build the
- * @param adminClientConfigCustomizers to customize {@link AdminClient}.
- * {@link AdminClient}.
- */
- public KafkaTopicProvisioner(
- KafkaBinderConfigurationProperties kafkaBinderConfigurationProperties,
- KafkaProperties kafkaProperties,
- List adminClientConfigCustomizers) {
-
- Assert.isTrue(kafkaProperties != null, "KafkaProperties cannot be null");
- this.configurationProperties = kafkaBinderConfigurationProperties;
- this.adminClientProperties = kafkaProperties.buildAdminProperties();
- normalalizeBootPropsWithBinder(this.adminClientProperties, kafkaProperties,
- kafkaBinderConfigurationProperties);
- // If the application provides AdminConfig customizers
- // and overrides properties, those take precedence.
- adminClientConfigCustomizers.forEach(customizer -> customizer.configure(this.adminClientProperties));
- }
-
- /**
- * Return an unmodifiable map of merged admin properties.
- * @return the properties.
- * @since 4.0.3
- */
- public Map getAdminClientProperties() {
- return Collections.unmodifiableMap(this.adminClientProperties);
- }
-
- /**
- * Mutator for metadata retry operations.
- * @param metadataRetryOperations the retry configuration
- */
- public void setMetadataRetryOperations(RetryOperations metadataRetryOperations) {
- this.metadataRetryOperations = metadataRetryOperations;
- }
-
- @Override
- public void afterPropertiesSet() {
- if (this.metadataRetryOperations == null) {
- RetryTemplate retryTemplate = new RetryTemplate();
-
- SimpleRetryPolicy simpleRetryPolicy = new SimpleRetryPolicy();
- simpleRetryPolicy.setMaxAttempts(10);
- retryTemplate.setRetryPolicy(simpleRetryPolicy);
-
- ExponentialBackOffPolicy backOffPolicy = new ExponentialBackOffPolicy();
- backOffPolicy.setInitialInterval(100);
- backOffPolicy.setMultiplier(2);
- backOffPolicy.setMaxInterval(1000);
- retryTemplate.setBackOffPolicy(backOffPolicy);
- this.metadataRetryOperations = retryTemplate;
- }
- }
-
- @Override
- public ProducerDestination provisionProducerDestination(final String name,
- ExtendedProducerProperties properties) {
-
- if (logger.isInfoEnabled()) {
- logger.info("Using kafka topic for outbound: " + name);
- }
- if (this.configurationProperties.isAutoCreateTopics()) {
- KafkaTopicUtils.validateTopicName(name);
- try (AdminClient adminClient = createAdminClient()) {
- createTopic(adminClient, name, properties.getPartitionCount(), false,
- properties.getExtension().getTopic());
- int partitions = getPartitionsForTopic(name, adminClient);
- return new KafkaProducerDestination(name, partitions);
- }
- }
- return new KafkaProducerDestination(name, 0);
- }
-
- @Override
- public ConsumerDestination provisionConsumerDestination(final String name,
- final String group,
- ExtendedConsumerProperties properties) {
- if (!properties.isMultiplex()) {
- return doProvisionConsumerDestination(name, group, properties);
- }
- else {
- String[] destinations = StringUtils.commaDelimitedListToStringArray(name);
- for (String destination : destinations) {
- doProvisionConsumerDestination(destination.trim(), group, properties);
- }
- return new KafkaConsumerDestination(name);
- }
- }
-
- private ConsumerDestination doProvisionConsumerDestination(final String name,
- final String group,
- ExtendedConsumerProperties properties) {
- final KafkaConsumerDestination kafkaConsumerDestination = new KafkaConsumerDestination(name);
- if (properties.getExtension().isDestinationIsPattern()) {
- Assert.isTrue(!properties.getExtension().isEnableDlq(),
- "enableDLQ is not allowed when listening to topic patterns");
- if (logger.isDebugEnabled()) {
- logger.debug("Listening to a topic pattern - " + name
- + " - no provisioning performed");
- }
- return kafkaConsumerDestination;
- }
- if (this.configurationProperties.isAutoCreateTopics()) {
- KafkaTopicUtils.validateTopicName(name);
- boolean anonymous = !StringUtils.hasText(group);
- Assert.isTrue(!anonymous || !properties.getExtension().isEnableDlq(),
- "DLQ support is not available for anonymous subscriptions");
- if (properties.getInstanceCount() == 0) {
- throw new IllegalArgumentException("Instance count cannot be zero");
- }
- int partitionCount = properties.getInstanceCount() * properties.getConcurrency();
- ConsumerDestination consumerDestination;
- try (AdminClient adminClient = createAdminClient()) {
- createTopic(adminClient, name, partitionCount,
- properties.getExtension().isAutoRebalanceEnabled(),
- properties.getExtension().getTopic());
- int partitions = getPartitionsForTopic(name, adminClient);
- consumerDestination = createDlqIfNeedBe(adminClient, name, group,
- properties, anonymous, partitions);
- if (consumerDestination == null) {
- consumerDestination = new KafkaConsumerDestination(name,
- partitions);
- }
- return consumerDestination;
- }
- }
- return kafkaConsumerDestination;
- }
- private int getPartitionsForTopic(String topicName, AdminClient adminClient) {
- int partitions = 0;
- Map topicDescriptions = retrieveTopicDescriptions(topicName, adminClient);
- TopicDescription topicDescription = topicDescriptions.get(topicName);
- if (topicDescription != null) {
- partitions = topicDescription.partitions().size();
- }
- return partitions;
- }
-
- private Map retrieveTopicDescriptions(String topicName, AdminClient adminClient) {
- return this.metadataRetryOperations.execute(context -> {
- try {
- if (logger.isDebugEnabled()) {
- logger.debug("Attempting to retrieve the description for the topic: " + topicName);
- }
- DescribeTopicsResult describeTopicsResult = adminClient
- .describeTopics(Collections.singletonList(topicName));
- KafkaFuture