Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to Spring Boot 3.0.0 #1287

Merged
merged 185 commits into from
Jan 19, 2023
Merged
Show file tree
Hide file tree
Changes from 155 commits
Commits
Show all changes
185 commits
Select commit Hold shift + click to select a range
1ff21cd
applied `boot-autoconfiguration-update`
JoeWang1127 Sep 13, 2022
4b3f6db
extract sleuth dependency from spring-cloud-dependencies to io.microm…
JoeWang1127 Oct 11, 2022
4adeaeb
add jakarta dependency
JoeWang1127 Oct 11, 2022
55e9732
extends crud repository for sorting repositories
JoeWang1127 Oct 12, 2022
fee80b9
remove joda time and ThreeTenBackport
JoeWang1127 Oct 12, 2022
5b4194d
remove deprecated method `getPersistentEntityTypes`
JoeWang1127 Oct 12, 2022
7d3b4ab
add sleuth starter dependency since it's not included in spring cloud…
JoeWang1127 Oct 12, 2022
ea84566
add dependencies for micrometer tracing
JoeWang1127 Oct 12, 2022
d7f8b74
upgrade java in maven plugin to 17
JoeWang1127 Oct 12, 2022
75546dd
remove transitive dependencies
JoeWang1127 Oct 12, 2022
3ebb756
fix broken unit tests
JoeWang1127 Oct 12, 2022
62e735b
remove sleuth starter dependency
JoeWang1127 Oct 13, 2022
b1f06c1
add io.micrometer dependency
JoeWang1127 Oct 13, 2022
5c69c3e
refacter test class
JoeWang1127 Oct 13, 2022
f50be0d
remove BraveHttpConfiguration as it is deprecated
JoeWang1127 Oct 14, 2022
701a022
add actuator starter dependency
JoeWang1127 Oct 15, 2022
eef5d36
remove BraveHttpConfiguration
JoeWang1127 Oct 15, 2022
fbfa218
fix broken unit tests
JoeWang1127 Oct 15, 2022
d2c4a52
remove usage of a deprecated constructor
JoeWang1127 Oct 21, 2022
d79a3cb
code refactor
JoeWang1127 Oct 21, 2022
95be0fd
remove the usage of a deprecated constructor
JoeWang1127 Oct 22, 2022
fbaba86
refactor tests
JoeWang1127 Oct 22, 2022
e8279b8
change to functional programming model
JoeWang1127 Oct 25, 2022
622173c
remove deprecated class in comments
JoeWang1127 Oct 25, 2022
748cef3
fix broken unit tests
JoeWang1127 Oct 25, 2022
33b58d7
rebase
JoeWang1127 Oct 25, 2022
177cd74
fix broken unit testd
JoeWang1127 Oct 25, 2022
55e6d5b
rebase
JoeWang1127 Oct 25, 2022
20d8e51
change extended binding properties tests according to spring style
JoeWang1127 Oct 27, 2022
bc50f97
improve line coverage
JoeWang1127 Oct 27, 2022
8497447
update errorprone to 2.16
JoeWang1127 Oct 30, 2022
ebc8745
refactor code
JoeWang1127 Oct 30, 2022
e314000
fix broken tests
JoeWang1127 Oct 30, 2022
26f82a0
log nested exception message explicitly
JoeWang1127 Nov 1, 2022
6d76791
refactor test code
JoeWang1127 Nov 1, 2022
5c91a7b
remove deprecated class `ClassTypeInformation`
JoeWang1127 Nov 1, 2022
32910e3
fix broken unit test
JoeWang1127 Nov 3, 2022
9b052ba
remove usage of `ClassTypeInformation.class`
JoeWang1127 Nov 3, 2022
a17839f
add generics so that unit tests can pass
JoeWang1127 Nov 3, 2022
4a9df3e
change name of an overridden method: `getPersistentEntityTypeInformat…
JoeWang1127 Nov 3, 2022
7f30232
fix broken unit test
JoeWang1127 Nov 3, 2022
79a2727
remove spring native support module
JoeWang1127 Nov 3, 2022
e62807e
replace javax to jakarta
JoeWang1127 Nov 7, 2022
afe7b9a
change package for `LocalServerPort`
JoeWang1127 Nov 7, 2022
9c98ec9
remove deprecated class `WebSecurityConfigurerAdapter`
JoeWang1127 Nov 7, 2022
dad0794
implement new auto configuration style
JoeWang1127 Nov 7, 2022
6c16903
experiment with samples
JoeWang1127 Nov 8, 2022
7bb67b7
merge dependencies pom
JoeWang1127 Nov 9, 2022
00a8381
change sampling property
JoeWang1127 Nov 9, 2022
d5116e5
exclude `ZipkinAutoConfiguration`
JoeWang1127 Nov 9, 2022
1935ca9
add firestore transaction manager
JoeWang1127 Nov 10, 2022
84a0572
change org of `r2dbc-postgresql`
JoeWang1127 Nov 10, 2022
4990427
update spring-shell-starter to 3.0.0-M1
JoeWang1127 Nov 10, 2022
484f7f9
refactor datastore basic example
JoeWang1127 Nov 10, 2022
bf7f477
polish datastore example
JoeWang1127 Nov 10, 2022
de3d749
change table name
JoeWang1127 Nov 10, 2022
211858c
change java version in ci
JoeWang1127 Nov 10, 2022
5369490
update failsafe plugin to 3.0.0-M7
JoeWang1127 Nov 10, 2022
30f84c8
remove java 8 and 11
JoeWang1127 Nov 10, 2022
8b9e800
remove unused import
JoeWang1127 Nov 10, 2022
6573b71
change javadoc plugin source
JoeWang1127 Nov 10, 2022
ba5d04f
fix checkstyle error
JoeWang1127 Nov 10, 2022
6ebfe0e
upgrade javadoc plugin source to 17
JoeWang1127 Nov 10, 2022
3eb1121
upgrade spring boot to 3.0.0-RC2
JoeWang1127 Nov 11, 2022
5c6741e
upgrade spring boot to 3.0.0-RC2 in samples
JoeWang1127 Nov 11, 2022
3a0566f
fix spanner repository sample
JoeWang1127 Nov 11, 2022
9218a70
refactor pubsub example
JoeWang1127 Nov 14, 2022
851fdd8
remove `ListenableFuture` as it is deprecated
JoeWang1127 Nov 15, 2022
b388e38
remove `ListenableFuture` in samples
JoeWang1127 Nov 15, 2022
9e671c8
remove `ListenableFuture` in bigquery module
JoeWang1127 Nov 15, 2022
92714e2
remove `ListenableFuture` in bigquery sample
JoeWang1127 Nov 15, 2022
8cff842
add return in `whenComplete` method
JoeWang1127 Nov 15, 2022
b877bb1
fix bigquery integration tests
JoeWang1127 Nov 15, 2022
b73298b
add `BinderFactoryAutoConfiguration`
JoeWang1127 Nov 15, 2022
63e2c0b
rebase branch onto main
JoeWang1127 Nov 15, 2022
9d756cd
fix integration tests in kotlin example
JoeWang1127 Nov 17, 2022
bcb7614
upgrade spring-cloud-dependencies to 2022.0.0-RC2
JoeWang1127 Nov 18, 2022
0d9541d
upgrade spring-cloud-dependencies-parent to 4.0.0-M5
JoeWang1127 Nov 18, 2022
230961f
fix pubsub stream dead letter sample
JoeWang1127 Nov 18, 2022
bfea5cc
remove `ArgumentCaptor`
JoeWang1127 Nov 18, 2022
a12a51b
fix `testProducerAndConsumerCustomizers`
JoeWang1127 Nov 18, 2022
2ab8e2d
fix bigquery sample integration tests
JoeWang1127 Nov 18, 2022
db17440
remove SpanCustomizer as it is provided by Spring
JoeWang1127 Nov 22, 2022
33d891c
refactor code
JoeWang1127 Nov 22, 2022
351387e
remove `GcpSecretManagerBootstrapConfiguration`
JoeWang1127 Nov 22, 2022
4dc37ba
fix integration test in pubsub bus sample
JoeWang1127 Nov 23, 2022
4ad2972
polish smell code
JoeWang1127 Nov 23, 2022
55ff0a0
remove `createSubscriberStub` method as it is deprecated
JoeWang1127 Nov 25, 2022
1e699eb
upgrade to spring boot 3.0
JoeWang1127 Nov 26, 2022
e447598
upgrade spring-boot-starter-parent to 3.0.0
JoeWang1127 Nov 26, 2022
9f529ad
temporily fix integration test in trace sample
JoeWang1127 Nov 28, 2022
11cf668
remove errorprone_java8
JoeWang1127 Nov 28, 2022
a330db2
add spring aop dependency
JoeWang1127 Nov 28, 2022
2f70f6a
add`ObservedAspect` bean to enable `Observed` annotation
JoeWang1127 Nov 28, 2022
7ba4e78
fix integration test in trace samples
JoeWang1127 Nov 28, 2022
bb2d57a
fix broken tests
JoeWang1127 Nov 28, 2022
64951ba
change package
JoeWang1127 Nov 28, 2022
74f470e
add param to fix integration tests
JoeWang1127 Nov 28, 2022
bded71a
change variable name for `r2dbc-mysql` dependency
JoeWang1127 Nov 29, 2022
d8dc163
remove deprecated `BigQueryTemplate` constructors
JoeWang1127 Nov 29, 2022
f342c12
remove deprecated `SpannerPersistentEntityImpl` method
JoeWang1127 Nov 29, 2022
f0d250f
remove deprecated `getSubscriber` method
JoeWang1127 Nov 29, 2022
9324ffb
remove deprecated `computeSubscriberFlowControlSettings` method
JoeWang1127 Nov 29, 2022
1934009
remove deprecated `computeSubscriberRetrySettings` method
JoeWang1127 Nov 29, 2022
9cc6ba9
remove deprecated constructor
JoeWang1127 Nov 29, 2022
03aaa86
remove used private method
JoeWang1127 Nov 29, 2022
5478337
remove deprecated methods
JoeWang1127 Nov 29, 2022
96d96a0
remove deprecated method
JoeWang1127 Nov 29, 2022
9848f3f
remove deprecated `getUpdateTime` method
JoeWang1127 Nov 30, 2022
f3d673a
fix broken tests
JoeWang1127 Nov 30, 2022
feebdf4
change `getModified` to return milliseconds rather than seconds
JoeWang1127 Nov 30, 2022
3efe079
polish
JoeWang1127 Nov 30, 2022
5861565
improve test coverage
JoeWang1127 Nov 30, 2022
2d3f05e
delete the mysql r2dbc sample from samples module
JoeWang1127 Dec 2, 2022
e47a96d
remove mysql r2dbc support
JoeWang1127 Dec 2, 2022
aeca912
upgrade r2dbc-postgresql to 1.0.0
JoeWang1127 Dec 3, 2022
1071518
polish
JoeWang1127 Dec 3, 2022
280fbbc
fix broken unit test
JoeWang1127 Dec 3, 2022
cff3fa4
improve line coverage
JoeWang1127 Dec 3, 2022
dc22210
change lastModifed to return milliseconds
JoeWang1127 Dec 3, 2022
4370cc7
improve test coverage
JoeWang1127 Dec 3, 2022
2827c4d
improve test coverage
JoeWang1127 Dec 4, 2022
f858983
improve test coverage
JoeWang1127 Dec 4, 2022
c6e688e
upgrade `spring-cloud-dependencies-parent` to `4.0.0-RC3`
JoeWang1127 Dec 4, 2022
0f43c1c
restore kotlin sample to use mysql instance
JoeWang1127 Dec 7, 2022
8b3ac18
add java 19 support for unit tests
JoeWang1127 Dec 8, 2022
c3c0e72
remove unused beans in trace
JoeWang1127 Dec 9, 2022
18cbbdd
remove `ListenableFuture` in vision
JoeWang1127 Dec 9, 2022
c76916a
fix integration test in vision
JoeWang1127 Dec 9, 2022
6befc87
remove unused import
JoeWang1127 Dec 9, 2022
bea4103
upgrade to newest version
JoeWang1127 Dec 9, 2022
4f4d08a
restore version
JoeWang1127 Dec 9, 2022
9a1a4b9
remove `StackdriverHttpRequestParser`
JoeWang1127 Dec 9, 2022
0b738e4
update docs of secret manager
JoeWang1127 Dec 11, 2022
6c4a1e7
turn off `CanIgnoreReturnValue` in errorprone
JoeWang1127 Dec 11, 2022
3529b11
implement new auto configuration style
JoeWang1127 Dec 11, 2022
dfd5263
order configuration files
JoeWang1127 Dec 11, 2022
e946ae6
remove r2dbc-mysql starter and sample
JoeWang1127 Dec 11, 2022
6e7a28d
remove `ListenableFuture` in docs
JoeWang1127 Dec 12, 2022
6e41589
remove `ListenableFuture` in comments
JoeWang1127 Dec 12, 2022
6ca1b63
remove legacy pubsub stream examples
JoeWang1127 Dec 12, 2022
61b9dd6
remove r2dbc-mysql in docs
JoeWang1127 Dec 12, 2022
5a684ea
fix smell code
JoeWang1127 Dec 12, 2022
b0e1125
restore change
JoeWang1127 Dec 12, 2022
568c9aa
restore dir in docs
JoeWang1127 Dec 12, 2022
6e81ab4
remove unused import
JoeWang1127 Dec 12, 2022
5b41272
upgrade kotlin version to 1.7.21
JoeWang1127 Dec 12, 2022
87ee6d4
fix stream docs
JoeWang1127 Dec 12, 2022
47464dc
refactor test code
JoeWang1127 Dec 12, 2022
403e5f6
refactor test code
JoeWang1127 Dec 12, 2022
fc38c88
merge changes in main
JoeWang1127 Dec 14, 2022
c6346ef
remove graalvm in github workflow
JoeWang1127 Dec 14, 2022
56de037
remove sleuth in docs and comments
JoeWang1127 Dec 14, 2022
df93249
change errorprone java baseline to 17
JoeWang1127 Dec 14, 2022
8482a7f
polish code
JoeWang1127 Dec 14, 2022
d4abf85
change version to 4.0
JoeWang1127 Dec 15, 2022
b657aab
merge with main
JoeWang1127 Dec 15, 2022
7fa2d53
renew copyright
JoeWang1127 Dec 15, 2022
f359098
remove parent in dependencies pom
JoeWang1127 Dec 15, 2022
010296f
remove experimental dependencies
JoeWang1127 Dec 19, 2022
def6ec3
change spring cloud dependencies to 2022.0
JoeWang1127 Dec 19, 2022
6753e61
upgrade spring-cloud-config dependency to 4.0.0
JoeWang1127 Dec 19, 2022
d0fbfea
remove spring milestone repo in production
JoeWang1127 Dec 19, 2022
fabe4e4
merge main
JoeWang1127 Dec 19, 2022
0b9c404
change datastore basic example to web-based app
JoeWang1127 Dec 20, 2022
2bf839f
remove spring native version num
JoeWang1127 Dec 20, 2022
32ab83e
restore version-update tag
JoeWang1127 Jan 4, 2023
1c76d81
merge main
JoeWang1127 Jan 4, 2023
ef3e5f4
restore dependency format
JoeWang1127 Jan 4, 2023
52d475c
restore dependency format
JoeWang1127 Jan 4, 2023
b494f41
restore serialized page test
JoeWang1127 Jan 4, 2023
fd33f89
modify changlog
JoeWang1127 Jan 5, 2023
1ee9fb7
merge main
JoeWang1127 Jan 5, 2023
8f11ce4
add versions.txt
JoeWang1127 Jan 5, 2023
f9e9068
delete native support test in samples
JoeWang1127 Jan 5, 2023
debcf3f
add migration guide
JoeWang1127 Jan 18, 2023
4a57d14
merge main
JoeWang1127 Jan 18, 2023
131a161
remove trash files
JoeWang1127 Jan 18, 2023
911aeb8
change to one sentence per line
JoeWang1127 Jan 18, 2023
7fefee2
add migration guide (markdown format)
JoeWang1127 Jan 19, 2023
dcdab0a
add link to migration guides
JoeWang1127 Jan 19, 2023
5931470
remove cross references
JoeWang1127 Jan 19, 2023
92e5ca5
specify min java version
JoeWang1127 Jan 19, 2023
3c819f2
restructure sections
JoeWang1127 Jan 19, 2023
551b27b
restore maven-resources-plugin version
JoeWang1127 Jan 19, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 2 additions & 18 deletions .github/workflows/integrationTests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,26 +50,10 @@ jobs:
id: date
run: echo "::set-output name=date::$(date +'%Y-%m-%d' --utc)"
- uses: actions/checkout@v2
- name: Setup Java 11
- name: Setup Java 17
uses: actions/setup-java@v1
if: matrix.it != 'native'
with:
java-version: 11
- name: Setup GraalVM
uses: DeLaGuardo/setup-graalvm@4.0
if: matrix.it == 'native' # note that this is no longer in the matrix
with:
graalvm: '21.2.0'
java: 'java11'
arch: 'amd64'
- name: Install GraalVM Native Image
if: matrix.it == 'native'
run: gu install native-image
- uses: actions/cache@v2
id: mvn-cache
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-unified-${{ steps.date.outputs.date }}
java-version: 17
- name: Setup gcloud
uses: google-github-actions/setup-gcloud@v0
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/sonar.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ jobs:
- uses: actions/checkout@v2
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Set up JDK 11
- name: Set up JDK 17
uses: actions/setup-java@v1
with:
java-version: 11
java-version: 17
- name: Cache SonarCloud packages
uses: actions/cache@v2
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/unitTests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
strategy:
fail-fast: false
matrix:
java: [8, 11, 17]
java: [17, 19]
steps:
- name: Get current date
id: date
Expand Down Expand Up @@ -103,7 +103,7 @@ jobs:

- uses: actions/setup-java@v1
with:
java-version: 11
java-version: 17

- uses: actions/cache@v2
id: mvn-cache
Expand Down
1 change: 0 additions & 1 deletion README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ Currently, this repository provides support for:
** link:spring-cloud-gcp-starters/spring-cloud-gcp-starter-sql-mysql[Google Cloud SQL MySQL]
** link:spring-cloud-gcp-starters/spring-cloud-gcp-starter-sql-postgresql[Google Cloud SQL PostgreSQL]
** link:spring-cloud-gcp-starters/spring-cloud-gcp-starter-storage[Google Cloud Storage]
** link:spring-cloud-gcp-starters/spring-cloud-gcp-starter-trace[Google Cloud Trace with Spring Cloud Sleuth]
** link:spring-cloud-gcp-starters/spring-cloud-gcp-starter-secretmanager[Google Secret Manager]
** link:spring-cloud-gcp-starters/spring-cloud-gcp-starter-security-firebase[Firebase Authentication]
** link:spring-cloud-gcp-starters/spring-cloud-gcp-starter-security-iap[Google Cloud IAP Authentication]
Expand Down
10 changes: 5 additions & 5 deletions docs/src/main/asciidoc/bigquery.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ Below is a code snippet of how to load a CSV data `InputStream` to a BigQuery ta
BigQueryTemplate bigQueryTemplate;

public void loadData(InputStream dataInputStream, String tableName) {
ListenableFuture<Job> bigQueryJobFuture =
CompletableFuture<Job> bigQueryJobFuture =
bigQueryTemplate.writeDataToTable(
tableName,
dataFile.getInputStream(),
Expand All @@ -111,7 +111,7 @@ BigQueryTemplate bigQueryTemplate;
*/
public void loadJsonStream(String tableName, InputStream jsonInputStream)
throws ExecutionException, InterruptedException {
ListenableFuture<WriteApiResponse> writeApFuture =
CompletableFuture<WriteApiResponse> writeApFuture =
bigQueryTemplate.writeJsonStream(tableName, jsonInputStream);
WriteApiResponse apiRes = writeApFuture.get();//get the WriteApiResponse
if (!apiRes.isSuccessful()){
Expand Down Expand Up @@ -139,7 +139,7 @@ BigQueryTemplate bigQueryTemplate;
*/
public void createTableAndloadJsonStream(String tableName, InputStream jsonInputStream, Schema tableSchema)
throws ExecutionException, InterruptedException {
ListenableFuture<WriteApiResponse> writeApFuture =
CompletableFuture<WriteApiResponse> writeApFuture =
bigQueryTemplate.writeJsonStream(tableName, jsonInputStream, tableSchema);//using the overloaded method which created the table when tableSchema is passed
WriteApiResponse apiRes = writeApFuture.get();//get the WriteApiResponse
if (!apiRes.isSuccessful()){
Expand Down Expand Up @@ -200,12 +200,12 @@ Alternatively, you may omit these headers and explicitly set the table name or f
After the `BigQueryFileMessageHandler` processes a message to load data to your BigQuery table, it will respond with a `Job` on the reply channel.
The https://googleapis.dev/java/google-cloud-clients/latest/index.html?com/google/cloud/bigquery/package-summary.html[Job object] provides metadata and information about the load file operation.

By default, the `BigQueryFileMessageHandler` is run in asynchronous mode, with `setSync(false)`, and it will reply with a `ListenableFuture<Job>` on the reply channel.
By default, the `BigQueryFileMessageHandler` is run in asynchronous mode, with `setSync(false)`, and it will reply with a `CompletableFuture<Job>` on the reply channel.
The future is tied to the status of the data loading job and will complete when the job completes.

If the handler is run in synchronous mode with `setSync(true)`, then the handler will block on the completion of the loading job and block until it is complete.

NOTE: If you decide to use Spring Integration Gateways and you wish to receive `ListenableFuture<Job>` as a reply object in the Gateway, you will have to call `.setAsyncExecutor(null)` on your `GatewayProxyFactoryBean`.
NOTE: If you decide to use Spring Integration Gateways and you wish to receive `CompletableFuture<Job>` as a reply object in the Gateway, you will have to call `.setAsyncExecutor(null)` on your `GatewayProxyFactoryBean`.
This is needed to indicate that you wish to reply on the built-in async support rather than rely on async handling of the gateway.

=== Sample
Expand Down
2 changes: 1 addition & 1 deletion docs/src/main/asciidoc/first-page.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Spring Framework on Google Cloud lets you leverage the power and simplicity of t
- Map objects, relationships, and collections with Spring Data Cloud Spanner, Spring Data Cloud Datastore and Spring Data Reactive Repositories for Cloud Firestore
- Write and read from Spring Resources backed up by Google Cloud Storage
- Exchange messages with Spring Integration using Google Cloud Pub/Sub on the background
- Trace the execution of your app with Spring Cloud Sleuth and Google Cloud Trace
- Trace the execution of your app with Micrometer and Google Cloud Trace
- Configure your app with Spring Cloud Config, backed up by the Google Runtime Configuration API
- Consume and produce Google Cloud Storage data via Spring Integration GCS Channel Adapters
- Use Spring Security via Google Cloud IAP
Expand Down
2 changes: 1 addition & 1 deletion docs/src/main/asciidoc/index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Spring Framework on Google Cloud lets you leverage the power and simplicity of t
- Map objects, relationships, and collections with Spring Data Cloud Spanner, Spring Data Cloud Datastore and Spring Data Reactive Repositories for Cloud Firestore
- Write and read from Spring Resources backed up by Google Cloud Storage
- Exchange messages with Spring Integration using Google Cloud Pub/Sub on the background
- Trace the execution of your app with Spring Cloud Sleuth and Google Cloud Trace
- Trace the execution of your app with Micrometer and Google Cloud Trace
- Configure your app with Spring Cloud Config, backed up by the Google Runtime Configuration API
- Consume and produce Google Cloud Storage data via Spring Integration GCS Channel Adapters
- Use Spring Security via Google Cloud IAP
Expand Down
10 changes: 5 additions & 5 deletions docs/src/main/asciidoc/logging.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ dependencies {
https://cloud.google.com/logging/[Cloud Logging] is the managed logging service provided by Google Cloud.

This module provides support for associating a web request trace ID with the corresponding log entries.
It does so by retrieving the `X-B3-TraceId` value from the https://logback.qos.ch/manual/mdc.html[Mapped Diagnostic Context (MDC)], which is set by Spring Cloud Sleuth.
If Spring Cloud Sleuth isn't used, the configured `TraceIdExtractor` extracts the desired header value and sets it as the log entry's trace ID.
It does so by retrieving the `X-B3-TraceId` value from the https://logback.qos.ch/manual/mdc.html[Mapped Diagnostic Context (MDC)], which is set by Micrometer.
If Micrometer isn't used, the configured `TraceIdExtractor` extracts the desired header value and sets it as the log entry's trace ID.
This allows grouping of log messages by request, for example, in the https://console.cloud.google.com/logs/viewer[Google Cloud Console Logs viewer].

NOTE: Due to the way logging is set up, the Google Cloud project ID and credentials defined in `application.properties` are ignored.
Expand All @@ -35,12 +35,12 @@ You can do this easily if you're using the https://cloud.google.com/sdk[Google C

For use in Web MVC-based applications, `TraceIdLoggingWebMvcInterceptor` is provided that extracts the request trace ID from an HTTP request using a `TraceIdExtractor` and stores it in a thread-local, which can then be used in a logging appender to add the trace ID metadata to log messages.

WARNING: If Spring Framework on Google Cloud Trace is enabled, the logging module disables itself and delegates log correlation to Spring Cloud Sleuth.
WARNING: If Spring Framework on Google Cloud Trace is enabled, the logging module disables itself and delegates log correlation to Micrometer.

`LoggingWebMvcConfigurer` configuration class is also provided to help register the `TraceIdLoggingWebMvcInterceptor` in Spring MVC applications.

Applications hosted on the Google Cloud include trace IDs under the `x-cloud-trace-context` header, which will be included in log entries.
However, if Sleuth is used the trace ID will be picked up from the MDC.
However, if Micrometer is used the trace ID will be picked up from the MDC.

=== Logback Support

Expand Down Expand Up @@ -141,7 +141,7 @@ If `projectId` is not set and cannot be determined, then it'll log `traceId` wit
| `includeLevel` | `true` | Should the severity be included
| `includeThreadName` | `true` | Should the thread name be included
| `includeMDC` | `true` | Should all MDC properties be included.
The MDC properties `X-B3-TraceId`, `X-B3-SpanId` and `X-Span-Export` provided by Spring Sleuth will get excluded as they get handled separately
The MDC properties `X-B3-TraceId`, `X-B3-SpanId` and `X-Span-Export` provided by Micrometer will get excluded as they get handled separately
| `includeLoggerName` | `true` | Should the name of the logger be included
| `includeFormattedMessage` | `true` | Should the formatted log message be included.
| `includeExceptionInMessage` | `true` | Should the stacktrace be appended to the formatted log message.
Expand Down
43 changes: 24 additions & 19 deletions docs/src/main/asciidoc/pubsub.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

Spring Framework on Google Cloud provides an abstraction layer to publish to and subscribe from Google Cloud Pub/Sub topics and to create, list or delete Google Cloud Pub/Sub topics and subscriptions.

A Spring Boot starter is provided to auto-configure the various required Pub/Sub components.
A Spring Boot starter is provided to autoconfigure the various required Pub/Sub components.

Maven coordinates, using <<getting-started.adoc#bill-of-materials, Spring Framework on Google Cloud BOM>>:

Expand Down Expand Up @@ -44,7 +44,7 @@ This section describes options for enabling the integration, specifying the Goog
Google Cloud Pub/Sub API, if different from the ones in the
<<spring-cloud-gcp-core,Spring Framework on Google Cloud Core Module>> | No |
| `spring.cloud.gcp.pubsub.emulator-host` | The host and port of the local running emulator.
If provided, this will setup the client to connect against a running https://cloud.google.com/pubsub/docs/emulator[Google Cloud Pub/Sub Emulator]. | No |
If provided, this will set up the client to connect against a running https://cloud.google.com/pubsub/docs/emulator[Google Cloud Pub/Sub Emulator]. | No |
| `spring.cloud.gcp.pubsub.credentials.encoded-key` | Base64-encoded contents of OAuth2 account private key for authenticating with the
Google Cloud Pub/Sub API, if different from the ones in the
<<spring-cloud-gcp-core,Spring Framework on Google Cloud Core Module>> | No |
Expand All @@ -58,9 +58,9 @@ Pub/Sub credentials | No | https://www.googleapis.com/auth/pubsub
This section describes configuration options to customize the behavior of the application's Pub/Sub publishers and subscribers.
Subscriber settings can be either global or subscription-specific.

NOTE: A custom configuration (injected through a setter in `DefaultSubscriberFactory` or a custom bean) will take precedence over auto-configuration.
NOTE: A custom configuration (injected through a setter in `DefaultSubscriberFactory` or a custom bean) will take precedence over autoconfiguration.
Hence, if one wishes to use per-subscription configuration for a Pub/Sub setting, there must not be a custom bean for that setting.
When using auto-configuration, if both global and per-subscription configurations are provided, then the per-subscription configuration will be used.
When using autoconfiguration, if both global and per-subscription configurations are provided, then the per-subscription configuration will be used.
However, if a per-subscription configuration is not set then the global or default configuration will be used.

|===
Expand Down Expand Up @@ -231,21 +231,23 @@ So, take care not to configure a subscription that has a business impact, or ins

If you are using Spring Boot Actuator, you can take advantage of the Cloud Pub/Sub subscription health indicator called `pubsub-subscriber`.
The subscription health indicator will verify whether Pub/Sub subscriptions are actively processing messages from the subscription's backlog.
To enable it, you need to add the https://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#production-ready[Spring Boot Actuator] to your project and the https://cloud.google.com/monitoring/docs/reference/libraries[Google Cloud Monitoring].
Also you need to set the following properties `spring.cloud.gcp.pubsub.health.lagThreshold`, `spring.cloud.gcp.pubsub.health.backlogThreshold`.
To enable it, you need to add the https://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#production-ready[Spring Boot Actuator] to your project and the https://cloud.google.com/monitoring/docs/reference/libraries[GCP Monitoring].
Also, you need to set the following properties `spring.cloud.gcp.pubsub.health.lagThreshold`, `spring.cloud.gcp.pubsub.health.backlogThreshold`.

The `pubsub-subscriber` indicator will then roll up to the overall application status visible at http://localhost:8080/actuator/health (use the `management.endpoint.health.show-details` property to view per-indicator details).

[source,xml]
----
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-monitoring</artifactId>
</dependency>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Formatting broke here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-monitoring</artifactId>
</dependency>
</dependencies>
----

The health indicator validates a subscriber's health by checking the subscription's message backlog and the last processed message.
Expand All @@ -255,7 +257,7 @@ If a message has been recently processed in a reasonable time threshold, then th
If the backlog of messages for a subscription is big but the subscriber consumes messages then subscriber is still healthy.
If there hasn't been any processing of recent messages but the backlog increases, then the subscriber is unhealthy.

NOTE: The health indicator will not behave entirely as expected if Dead Letter Queueing is enabled on the subscription being checked, num_undelivered_messages will drop down by itself after DLQ threshold is reached.
NOTE: The health indicator will not behave entirely as expected if Dead Letter Queueing is enabled on the subscription being checked, num_undelivered_messages will drop by itself after DLQ threshold is reached.

|===
| Name | Description | Required | Default value
Expand Down Expand Up @@ -373,7 +375,7 @@ Using these methods for acknowledging messages in batches is more efficient than

. To acknowledge messages individually you can use the `ack()` or `nack()` method on each of them (to acknowledge or negatively acknowledge, correspondingly).

NOTE: All `ack()`, `nack()`, and `modifyAckDeadline()` methods on messages, as well as `PubSubSubscriberTemplate`, are implemented asynchronously, returning a `ListenableFuture<Void>` to enable asynchronous processing.
NOTE: All `ack()`, `nack()`, and `modifyAckDeadline()` methods on messages, as well as `PubSubSubscriberTemplate`, are implemented asynchronously, returning a `CompletableFuture<Void>` to enable asynchronous processing.

===== Dead Letter Topics

Expand All @@ -399,7 +401,7 @@ public Subscription newSubscription() {
}
----

Dead letter topics are no different than any other topic, though some https://cloud.google.com/pubsub/docs/dead-letter-topics#granting_forwarding_permissions[additional permissions] are necessary to ensure the Cloud Pub/Sub service can successfully `ack` the original message and re-`publish` it on the dead letter topic.
Dead letter topics are no different from any other topic, though some https://cloud.google.com/pubsub/docs/dead-letter-topics#granting_forwarding_permissions[additional permissions] are necessary to ensure the Cloud Pub/Sub service can successfully `ack` the original message and re-`publish` on the dead letter topic.

==== JSON support

Expand Down Expand Up @@ -427,7 +429,7 @@ You can serialize objects to JSON on publish automatically:
include::{project-root}/spring-cloud-gcp-autoconfigure/src/test/java/com/google/cloud/spring/autoconfigure/pubsub/it/PubSubTemplateDocumentationIntegrationTests.java[tag=json_publish]
----

And that's how you convert messages to objects on pull:
And that's how you convert messages to object on pull:
[source,java,indent=0]
----
include::{project-root}/spring-cloud-gcp-autoconfigure/src/test/java/com/google/cloud/spring/autoconfigure/pubsub/it/PubSubTemplateDocumentationIntegrationTests.java[tag=json_pull]
Expand Down Expand Up @@ -483,7 +485,7 @@ It allows for the creation, deletion and listing of topics and subscriptions.

NOTE: Generally when referring to topics and subscriptions, you can either use the short canonical name within the current project, or the fully-qualified name referring to a topic or subscription in a different project using the `projects/[project_name]/(topics|subscriptions)/<name>` format.

The Spring Boot starter for Spring Framework on Google Cloud Pub/Sub auto-configures a `PubSubAdmin` object using the `GcpProjectIdProvider` and the `CredentialsProvider` auto-configured by the Spring Framework on Google Cloud Core Starter.
The Spring Boot starter for GCP Pub/Sub autoconfigures a `PubSubAdmin` object using the `GcpProjectIdProvider` and the `CredentialsProvider` autoconfigured by the Spring Boot GCP Core starter.

==== Creating a topic

Expand Down Expand Up @@ -547,6 +549,9 @@ public Subscription createSubscription(String subscriptionName, String topicName

public Subscription createSubscription(String subscriptionName, String topicName, Integer ackDeadline)

public Subscription createSubscription(
String subscriptionName, String topicName, String pushEndpoint)

public Subscription createSubscription(String subscriptionName, String topicName, Integer ackDeadline, String pushEndpoint)

public Subscription createSubscription(Subscriber.Builder builder)
Expand Down
Loading