Skip to content

Commit

Permalink
Prepare for Spring Cloud Azure 5.7.0 release (#37518)
Browse files Browse the repository at this point in the history
* update version client

* update version/changelog/readme

* Added overloads to saveAll and deleteAll APIs with both Publisher and Iterable (#37532) (#37533)

* Updated params of reactive bulk API to Iterable:

* Added additional APIs to match saveAll and deleteAll APIs from spring framework

* Removed unused imports

Co-authored-by: Kushagra Thapar <[email protected]>

---------

Co-authored-by: Trevor Anderson <[email protected]>
Co-authored-by: Kushagra Thapar <[email protected]>
  • Loading branch information
3 people authored Nov 7, 2023
1 parent a234bbe commit 2e81795
Show file tree
Hide file tree
Showing 85 changed files with 341 additions and 414 deletions.
10 changes: 10 additions & 0 deletions eng/code-quality-reports/src/main/resources/revapi/revapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,16 @@
"new": "method <S extends T, T> reactor.core.publisher.Flux<S> com.azure.spring.data.cosmos.core.ReactiveCosmosOperations::insertAll(com.azure.spring.data.cosmos.repository.support.CosmosEntityInformation<T, ?>, reactor.core.publisher.Flux<S>)",
"justification": "Spring interfaces are allowed to add methods."
},
{
"code": "java.method.addedToInterface",
"new": "method <S extends T, T> reactor.core.publisher.Mono<java.lang.Void> com.azure.spring.data.cosmos.core.ReactiveCosmosOperations::deleteEntities(com.azure.spring.data.cosmos.repository.support.CosmosEntityInformation<T, ?>, java.lang.Iterable<S>)",
"justification": "Spring interfaces are allowed to add methods."
},
{
"code": "java.method.addedToInterface",
"new": "method <S extends T, T> reactor.core.publisher.Flux<S> com.azure.spring.data.cosmos.core.ReactiveCosmosOperations::insertAll(com.azure.spring.data.cosmos.repository.support.CosmosEntityInformation<T, ?>, java.lang.Iterable<S>)",
"justification": "Spring interfaces are allowed to add methods."
},
{
"regex": true,
"code": "java\\.annotation\\.(added|attributeValueChanged)",
Expand Down
100 changes: 50 additions & 50 deletions eng/versioning/version_client.txt
Original file line number Diff line number Diff line change
Expand Up @@ -194,56 +194,56 @@ com.azure:azure-xml;1.0.0-beta.2;1.0.0-beta.3
com.azure:perf-test-core;1.0.0-beta.1;1.0.0-beta.1
com.azure.spring:azure-monitor-spring-native;1.0.0-beta.1;1.0.0-beta.1
com.azure.spring:azure-monitor-spring-native-test;1.0.0-beta.1;1.0.0-beta.1
com.azure.spring:spring-cloud-azure-appconfiguration-config-web;5.6.0;5.7.0-beta.1
com.azure.spring:spring-cloud-azure-appconfiguration-config;5.6.0;5.7.0-beta.1
com.azure.spring:spring-cloud-azure-feature-management-web;5.6.0;5.7.0-beta.1
com.azure.spring:spring-cloud-azure-feature-management;5.6.0;5.7.0-beta.1
com.azure.spring:spring-cloud-azure-starter-appconfiguration-config;5.6.0;5.7.0-beta.1
com.azure.spring:spring-cloud-azure-dependencies;5.6.0;5.7.0-beta.1
com.azure.spring:spring-messaging-azure;5.6.0;5.7.0-beta.1
com.azure.spring:spring-messaging-azure-eventhubs;5.6.0;5.7.0-beta.1
com.azure.spring:spring-messaging-azure-servicebus;5.6.0;5.7.0-beta.1
com.azure.spring:spring-messaging-azure-storage-queue;5.6.0;5.7.0-beta.1
com.azure.spring:spring-integration-azure-core;5.6.0;5.7.0-beta.1
com.azure.spring:spring-integration-azure-eventhubs;5.6.0;5.7.0-beta.1
com.azure.spring:spring-integration-azure-servicebus;5.6.0;5.7.0-beta.1
com.azure.spring:spring-integration-azure-storage-queue;5.6.0;5.7.0-beta.1
com.azure.spring:spring-cloud-azure-core;5.6.0;5.7.0-beta.1
com.azure.spring:spring-cloud-azure-actuator-autoconfigure;5.6.0;5.7.0-beta.1
com.azure.spring:spring-cloud-azure-actuator;5.6.0;5.7.0-beta.1
com.azure.spring:spring-cloud-azure-autoconfigure;5.6.0;5.7.0-beta.1
com.azure.spring:spring-cloud-azure-resourcemanager;5.6.0;5.7.0-beta.1
com.azure.spring:spring-cloud-azure-service;5.6.0;5.7.0-beta.1
com.azure.spring:spring-cloud-azure-starter-active-directory;5.6.0;5.7.0-beta.1
com.azure.spring:spring-cloud-azure-starter-active-directory-b2c;5.6.0;5.7.0-beta.1
com.azure.spring:spring-cloud-azure-starter-actuator;5.6.0;5.7.0-beta.1
com.azure.spring:spring-cloud-azure-starter-appconfiguration;5.6.0;5.7.0-beta.1
com.azure.spring:spring-cloud-azure-starter-cosmos;5.6.0;5.7.0-beta.1
com.azure.spring:spring-cloud-azure-starter-data-cosmos;5.6.0;5.7.0-beta.1
com.azure.spring:spring-cloud-azure-starter-eventhubs;5.6.0;5.7.0-beta.1
com.azure.spring:spring-cloud-azure-starter-eventgrid;5.6.0;5.7.0-beta.1
com.azure.spring:spring-cloud-azure-starter-jdbc-mysql;5.6.0;5.7.0-beta.1
com.azure.spring:spring-cloud-azure-starter-jdbc-postgresql;5.6.0;5.7.0-beta.1
com.azure.spring:spring-cloud-azure-starter-keyvault;5.6.0;5.7.0-beta.1
com.azure.spring:spring-cloud-azure-starter-keyvault-certificates;5.6.0;5.7.0-beta.1
com.azure.spring:spring-cloud-azure-starter-keyvault-secrets;5.6.0;5.7.0-beta.1
com.azure.spring:spring-cloud-azure-starter-servicebus-jms;5.6.0;5.7.0-beta.1
com.azure.spring:spring-cloud-azure-starter-servicebus;5.6.0;5.7.0-beta.1
com.azure.spring:spring-cloud-azure-starter-storage;5.6.0;5.7.0-beta.1
com.azure.spring:spring-cloud-azure-starter-storage-blob;5.6.0;5.7.0-beta.1
com.azure.spring:spring-cloud-azure-starter-storage-file-share;5.6.0;5.7.0-beta.1
com.azure.spring:spring-cloud-azure-starter-storage-queue;5.6.0;5.7.0-beta.1
com.azure.spring:spring-cloud-azure-starter-integration-eventhubs;5.6.0;5.7.0-beta.1
com.azure.spring:spring-cloud-azure-starter-integration-servicebus;5.6.0;5.7.0-beta.1
com.azure.spring:spring-cloud-azure-starter-integration-storage-queue;5.6.0;5.7.0-beta.1
com.azure.spring:spring-cloud-azure-starter-stream-eventhubs;5.6.0;5.7.0-beta.1
com.azure.spring:spring-cloud-azure-starter-stream-servicebus;5.6.0;5.7.0-beta.1
com.azure.spring:spring-cloud-azure-starter;5.6.0;5.7.0-beta.1
com.azure.spring:spring-cloud-azure-stream-binder-eventhubs-core;5.6.0;5.7.0-beta.1
com.azure.spring:spring-cloud-azure-stream-binder-eventhubs;5.6.0;5.7.0-beta.1
com.azure.spring:spring-cloud-azure-stream-binder-servicebus-core;5.6.0;5.7.0-beta.1
com.azure.spring:spring-cloud-azure-stream-binder-servicebus;5.6.0;5.7.0-beta.1
com.azure:azure-spring-data-cosmos;5.6.0;5.7.0-beta.1
com.azure.spring:spring-cloud-azure-appconfiguration-config-web;5.6.0;5.7.0
com.azure.spring:spring-cloud-azure-appconfiguration-config;5.6.0;5.7.0
com.azure.spring:spring-cloud-azure-feature-management-web;5.6.0;5.7.0
com.azure.spring:spring-cloud-azure-feature-management;5.6.0;5.7.0
com.azure.spring:spring-cloud-azure-starter-appconfiguration-config;5.6.0;5.7.0
com.azure.spring:spring-cloud-azure-dependencies;5.6.0;5.7.0
com.azure.spring:spring-messaging-azure;5.6.0;5.7.0
com.azure.spring:spring-messaging-azure-eventhubs;5.6.0;5.7.0
com.azure.spring:spring-messaging-azure-servicebus;5.6.0;5.7.0
com.azure.spring:spring-messaging-azure-storage-queue;5.6.0;5.7.0
com.azure.spring:spring-integration-azure-core;5.6.0;5.7.0
com.azure.spring:spring-integration-azure-eventhubs;5.6.0;5.7.0
com.azure.spring:spring-integration-azure-servicebus;5.6.0;5.7.0
com.azure.spring:spring-integration-azure-storage-queue;5.6.0;5.7.0
com.azure.spring:spring-cloud-azure-core;5.6.0;5.7.0
com.azure.spring:spring-cloud-azure-actuator-autoconfigure;5.6.0;5.7.0
com.azure.spring:spring-cloud-azure-actuator;5.6.0;5.7.0
com.azure.spring:spring-cloud-azure-autoconfigure;5.6.0;5.7.0
com.azure.spring:spring-cloud-azure-resourcemanager;5.6.0;5.7.0
com.azure.spring:spring-cloud-azure-service;5.6.0;5.7.0
com.azure.spring:spring-cloud-azure-starter-active-directory;5.6.0;5.7.0
com.azure.spring:spring-cloud-azure-starter-active-directory-b2c;5.6.0;5.7.0
com.azure.spring:spring-cloud-azure-starter-actuator;5.6.0;5.7.0
com.azure.spring:spring-cloud-azure-starter-appconfiguration;5.6.0;5.7.0
com.azure.spring:spring-cloud-azure-starter-cosmos;5.6.0;5.7.0
com.azure.spring:spring-cloud-azure-starter-data-cosmos;5.6.0;5.7.0
com.azure.spring:spring-cloud-azure-starter-eventhubs;5.6.0;5.7.0
com.azure.spring:spring-cloud-azure-starter-eventgrid;5.6.0;5.7.0
com.azure.spring:spring-cloud-azure-starter-jdbc-mysql;5.6.0;5.7.0
com.azure.spring:spring-cloud-azure-starter-jdbc-postgresql;5.6.0;5.7.0
com.azure.spring:spring-cloud-azure-starter-keyvault;5.6.0;5.7.0
com.azure.spring:spring-cloud-azure-starter-keyvault-certificates;5.6.0;5.7.0
com.azure.spring:spring-cloud-azure-starter-keyvault-secrets;5.6.0;5.7.0
com.azure.spring:spring-cloud-azure-starter-servicebus-jms;5.6.0;5.7.0
com.azure.spring:spring-cloud-azure-starter-servicebus;5.6.0;5.7.0
com.azure.spring:spring-cloud-azure-starter-storage;5.6.0;5.7.0
com.azure.spring:spring-cloud-azure-starter-storage-blob;5.6.0;5.7.0
com.azure.spring:spring-cloud-azure-starter-storage-file-share;5.6.0;5.7.0
com.azure.spring:spring-cloud-azure-starter-storage-queue;5.6.0;5.7.0
com.azure.spring:spring-cloud-azure-starter-integration-eventhubs;5.6.0;5.7.0
com.azure.spring:spring-cloud-azure-starter-integration-servicebus;5.6.0;5.7.0
com.azure.spring:spring-cloud-azure-starter-integration-storage-queue;5.6.0;5.7.0
com.azure.spring:spring-cloud-azure-starter-stream-eventhubs;5.6.0;5.7.0
com.azure.spring:spring-cloud-azure-starter-stream-servicebus;5.6.0;5.7.0
com.azure.spring:spring-cloud-azure-starter;5.6.0;5.7.0
com.azure.spring:spring-cloud-azure-stream-binder-eventhubs-core;5.6.0;5.7.0
com.azure.spring:spring-cloud-azure-stream-binder-eventhubs;5.6.0;5.7.0
com.azure.spring:spring-cloud-azure-stream-binder-servicebus-core;5.6.0;5.7.0
com.azure.spring:spring-cloud-azure-stream-binder-servicebus;5.6.0;5.7.0
com.azure:azure-spring-data-cosmos;5.6.0;5.7.0
com.azure.resourcemanager:azure-resourcemanager;2.32.0;2.33.0-beta.1
com.azure.resourcemanager:azure-resourcemanager-appplatform;2.32.0;2.33.0-beta.1
com.azure.resourcemanager:azure-resourcemanager-appservice;2.32.0;2.33.0-beta.1
Expand Down
4 changes: 2 additions & 2 deletions sdk/boms/spring-cloud-azure-dependencies/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>com.azure.spring</groupId>
<artifactId>spring-cloud-azure-dependencies</artifactId>
<version>5.7.0-beta.1</version> <!-- {x-version-update;com.azure.spring:spring-cloud-azure-dependencies;current} -->
<version>5.7.0</version> <!-- {x-version-update;com.azure.spring:spring-cloud-azure-dependencies;current} -->
<packaging>pom</packaging>

<name>Spring Cloud Azure Dependencies</name>
Expand Down Expand Up @@ -51,7 +51,7 @@
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-sdk-bom</artifactId>
<version>1.2.17</version> <!-- NOTE: This should be updated manually. -->
<version>1.2.18</version> <!-- NOTE: This should be updated manually. -->
<type>pom</type>
<scope>import</scope>
</dependency>
Expand Down
15 changes: 13 additions & 2 deletions sdk/spring/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
# Release History

## 5.7.0-beta.1 (Unreleased)
Upgrade Spring Boot dependencies version to 3.1.5 and Spring Cloud dependencies version to 2022.0.4
## 5.7.0 (2023-11-07)
- This release is compatible with Spring Boot 3.0.0-3.1.5. (Note: 3.1.x (x>3) should be supported, but they aren't tested with this release.)
- This release is compatible with Spring Cloud 2022.0.0-2022.0.4. (Note: 2022.0.x (x>4) should be supported, but they aren't tested with this release.)
- Now, Spring Boot 3.2.0-RC1 and Spring Cloud 2023.0.0-RC1 are compatible with this release.

### Spring Cloud Azure Dependencies (BOM)

#### Dependency Updates
- Upgrade `azure-sdk-bom` to 1.2.18.

### Spring Cloud Azure Autoconfigure
This section includes changes in `spring-cloud-azure-autoconfigure` module.
Expand All @@ -23,6 +30,10 @@ This section includes changes in `spring-cloud-azure-autoconfigure` module.
- Deprecated APIs `ServiceBusProvisioner.provisionQueue`, `ServiceBusProvisioner.provisionTopic`, `ServiceBusProvisioner.provisionSubscription` [#37151](https://github.com/Azure/azure-sdk-for-java/pull/37151).
- Add new methods to provision queue and topic with entity properties [#37151](https://github.com/Azure/azure-sdk-for-java/pull/37151).

### Azure Spring Data Cosmos
This section includes changes in `azure-spring-data-cosmos` module.
Please refer to [azure-spring-data-cosmos/CHANGELOG.md](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/spring/azure-spring-data-cosmos/CHANGELOG.md#570-2023-11-07) for more details.

## 5.6.0 (2023-10-24)
- This release is compatible with Spring Boot 3.0.0-3.1.3. (Note: 3.1.x (x>3) should be supported, but they aren't tested with this release.)
- This release is compatible with Spring Cloud 2022.0.0-2022.0.4. (Note: 2022.0.x (x>4) should be supported, but they aren't tested with this release.)
Expand Down
2 changes: 1 addition & 1 deletion sdk/spring/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ If you’re a Maven user, add our BOM to your pom.xml `<dependencyManagement>` s
<dependency>
<groupId>com.azure.spring</groupId>
<artifactId>spring-cloud-azure-dependencies</artifactId>
<version>5.6.0</version>
<version>5.7.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand Down
10 changes: 4 additions & 6 deletions sdk/spring/azure-spring-data-cosmos/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
## Release History

### 5.7.0-beta.1 (Unreleased)
### 5.7.0 (2023-11-07)

#### Features Added
* Updated Spring and Reactive Spring repository `saveAll` and `deleteAll` APIs to use bulk functionality implementation. NOTE: `azure-spring-data-cosmos` is currently unable to set throughput control limits at the request level, which will need to be achieved by creating multiple clients. - See [PR 36611](https://github.com/Azure/azure-sdk-for-java/pull/36611).

#### Breaking Changes

#### Bugs Fixed
* Updated Spring and Reactive Spring repository `saveAll` and `deleteAll` APIs to use bulk functionality implementation. NOTE: `azure-spring-data-cosmos` is currently unable to set throughput control limits at the request level, which will need to be achieved by creating multiple clients. - See [PR 37475](https://github.com/Azure/azure-sdk-for-java/pull/37475).

#### Other Changes
* Updated `azure-cosmos` to version `4.52.0`.
* Updated `Spring Data Commons` to version `3.1.5`.

### 5.6.0 (2023-10-24)

Expand Down
2 changes: 1 addition & 1 deletion sdk/spring/azure-spring-data-cosmos/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ If you are using Maven, add the following dependency.
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-spring-data-cosmos</artifactId>
<version>5.6.0</version>
<version>5.7.0</version>
</dependency>
```
[//]: # ({x-version-update-end})
Expand Down
2 changes: 1 addition & 1 deletion sdk/spring/azure-spring-data-cosmos/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

<groupId>com.azure</groupId>
<artifactId>azure-spring-data-cosmos</artifactId>
<version>5.7.0-beta.1</version> <!-- {x-version-update;com.azure:azure-spring-data-cosmos;current} -->
<version>5.7.0</version> <!-- {x-version-update;com.azure:azure-spring-data-cosmos;current} -->
<packaging>jar</packaging>
<name>Spring Data for Azure Cosmos DB SQL API</name>
<description>Spring Data for Azure Cosmos DB SQL API</description>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,17 @@ Mono<CosmosContainerProperties> replaceContainerProperties(String containerName,
*/
<T> Mono<T> insert(String containerName, T objectToSave);

/**
* Insert all items with bulk.
*
* @param entityInformation must not be {@literal null}
* @param entities must not be {@literal null}
* @param <T> type class of domain type
* @param <S> type class of domain type
* @return Flux of result
*/
<S extends T, T> Flux<S> insertAll(CosmosEntityInformation<T, ?> entityInformation, Iterable<S> entities);

/**
* Insert all items with bulk.
*
Expand Down Expand Up @@ -220,6 +231,17 @@ Mono<CosmosContainerProperties> replaceContainerProperties(String containerName,
*/
<T> Mono<Void> deleteEntity(String containerName, T entity);

/**
* Delete all items with bulk.
*
* @param entityInformation must not be {@literal null}
* @param entities must not be {@literal null}
* @param <T> type class of domain type
* @param <S> type class of domain type
* @return void Mono
*/
<S extends T, T> Mono<Void> deleteEntities(CosmosEntityInformation<T, ?> entityInformation, Iterable<S> entities);

/**
* Delete all items with bulk.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,20 @@ public <T> Mono<T> insert(String containerName, T objectToSave) {
* Insert all items with bulk.
*
* @param entityInformation the CosmosEntityInformation
* @param entities the Iterable entities to be deleted
* @param entities the Iterable entities to be inserted
* @param <T> type class of domain type
* @param <S> type class of domain type
* @return Flux of result
*/
public <S extends T, T> Flux<S> insertAll(CosmosEntityInformation<T, ?> entityInformation, Iterable<S> entities) {
return insertAll(entityInformation, Flux.fromIterable(entities));
}

/**
* Insert all items with bulk.
*
* @param entityInformation the CosmosEntityInformation
* @param entities the Flux of entities to be inserted
* @param <T> type class of domain type
* @param <S> type class of domain type
* @return Flux of result
Expand All @@ -498,19 +511,19 @@ public <S extends T, T> Flux<S> insertAll(CosmosEntityInformation<T, ?> entityIn
cosmosBulkExecutionOptions.setInitialMicroBatchSize(1);

return (Flux<S>) this.getCosmosAsyncClient()
.getDatabase(this.getDatabaseName())
.getContainer(containerName)
.executeBulkOperations(cosmosItemOperationsFlux, cosmosBulkExecutionOptions)
.publishOn(Schedulers.parallel())
.onErrorResume(throwable ->
CosmosExceptionUtils.exceptionHandler("Failed to insert item(s)", throwable,
this.responseDiagnosticsProcessor))
.flatMap(r -> {
CosmosUtils.fillAndProcessResponseDiagnostics(this.responseDiagnosticsProcessor,
r.getResponse().getCosmosDiagnostics(), null);
JsonNode responseItem = r.getResponse().getItem(JsonNode.class);
return responseItem != null ? Flux.just(toDomainObject(domainType, responseItem)) : Flux.empty();
});
.getDatabase(this.getDatabaseName())
.getContainer(containerName)
.executeBulkOperations(cosmosItemOperationsFlux, cosmosBulkExecutionOptions)
.publishOn(Schedulers.parallel())
.onErrorResume(throwable ->
CosmosExceptionUtils.exceptionHandler("Failed to insert item(s)", throwable,
this.responseDiagnosticsProcessor))
.flatMap(r -> {
CosmosUtils.fillAndProcessResponseDiagnostics(this.responseDiagnosticsProcessor,
r.getResponse().getCosmosDiagnostics(), null);
JsonNode responseItem = r.getResponse().getItem(JsonNode.class);
return responseItem != null ? Flux.just(toDomainObject(domainType, responseItem)) : Flux.empty();
});
}

/**
Expand Down Expand Up @@ -674,6 +687,19 @@ public <T> Mono<Void> deleteEntity(String containerName, T entity) {
return deleteItem(originalItem, containerName, domainType).then();
}

/**
* Delete all items with bulk.
*
* @param entityInformation the CosmosEntityInformation
* @param entities the Iterable entities to be deleted
* @param <T> type class of domain type
* @param <S> type class of domain type
* @return void Mono
*/
public <S extends T, T> Mono<Void> deleteEntities(CosmosEntityInformation<T, ?> entityInformation, Iterable<S> entities) {
return deleteEntities(entityInformation, Flux.fromIterable(entities));
}

/**
* Delete all items with bulk.
*
Expand Down Expand Up @@ -704,13 +730,13 @@ public <S extends T, T> Mono<Void> deleteEntities(CosmosEntityInformation<T, ?>
cosmosBulkExecutionOptions.setInitialMicroBatchSize(1);

return this.getCosmosAsyncClient()
.getDatabase(this.getDatabaseName())
.getContainer(containerName)
.executeBulkOperations(cosmosItemOperationFlux, cosmosBulkExecutionOptions)
.publishOn(Schedulers.parallel())
.onErrorResume(throwable ->
CosmosExceptionUtils.exceptionHandler("Failed to delete item(s)", throwable,
this.responseDiagnosticsProcessor)).then();
.getDatabase(this.getDatabaseName())
.getContainer(containerName)
.executeBulkOperations(cosmosItemOperationFlux, cosmosBulkExecutionOptions)
.publishOn(Schedulers.parallel())
.onErrorResume(throwable ->
CosmosExceptionUtils.exceptionHandler("Failed to delete item(s)", throwable,
this.responseDiagnosticsProcessor)).then();
}

/**
Expand Down
Loading

0 comments on commit 2e81795

Please sign in to comment.