This commit is contained in:
azure-sdk 2024-09-10 23:17:31 +00:00
Родитель 959d7dfae4
Коммит 6d46d77fc1
8 изменённых файлов: 225 добавлений и 35 удалений

Просмотреть файл

@ -1,12 +1,12 @@
---
title:
keywords: Azure, java, SDK, API, spring-cloud-azure-appconfiguration-config, spring
ms.date: 05/10/2024
ms.date: 09/10/2024
ms.topic: reference
ms.devlang: java
ms.service: spring
---
# Spring Cloud for Azure appconfiguration config client library for Java
See: [Spring Cloud for Azure App Configuration Starter](https://github.com/Azure/azure-sdk-for-java/tree/spring-cloud-azure-appconfiguration-config_5.12.0/sdk/spring/spring-cloud-azure-starter-appconfiguration-config)
See: [Spring Cloud for Azure App Configuration Starter](https://github.com/Azure/azure-sdk-for-java/tree/spring-cloud-azure-appconfiguration-config_5.16.0/sdk/spring/spring-cloud-azure-starter-appconfiguration-config)

Просмотреть файл

@ -1,7 +1,7 @@
---
title:
keywords: Azure, java, SDK, API, spring-cloud-azure-feature-management, spring
ms.date: 05/10/2024
ms.date: 09/10/2024
ms.topic: reference
ms.devlang: java
ms.service: spring
@ -49,10 +49,10 @@ feature-management:
feature-v:
enabled-for:
-
name: TimeWindowFilter
name: Microsoft.TimeWindow
parameters:
time-window-filter-setting-start: "Wed, 01 May 2019 13:59:59 GMT"
time-window-filter-setting-end: "Mon, 01 July 2019 00:00:00 GMT"
start: "Wed, 01 May 2019 13:59:59 GMT"
end: "Mon, 01 July 2019 00:00:00 GMT"
feature-w:
evaluate: false
enabled-for:
@ -190,7 +190,7 @@ feature-management:
### TimeWindowFilter
This filter provides the capability to enable a feature based on a time window. If only `time-window-filter-setting-end` is specified, the feature will be considered on until that time. If only start is specified, the feature will be considered on at all points after that time. If both are specified the feature will be considered valid between the two times.
This filter provides the capability to enable a feature based on a time window. If only `end` is specified, the feature will be considered enabled until that time. If only `start` is specified, the feature will be considered enabled at all points after that time. If both are specified the feature will be considered enabled between the two times.
```yaml
feature-management:
@ -198,12 +198,175 @@ feature-management:
feature-v:
enabled-for:
-
name: TimeWindowFilter
name: Microsoft.TimeWindow
parameters:
time-window-filter-setting-start: "Wed, 01 May 2019 13:59:59 GMT",
time-window-filter-setting-end: "Mon, 01 July 2019 00:00:00 GMT"
start: "Wed, 01 May 2019 13:59:59 GMT"
end: "Mon, 01 July 2019 00:00:00 GMT"
```
The time window can be configured to recur periodically. This can be useful in the scenario where you have to enable/disable a feature during low or high traffic periods of a day or for certain days of the week. To expand the individual time window to recurring time windows, the recurrence rule should be specified in the `recurrence` parameter.
```yaml
feature-management:
feature-flags:
feature-v:
enabled-for:
-
name: Microsoft.TimeWindow
parameters:
start: "Fri, 22 Mar 2024 20:00:00 GMT"
end: "Sat, 23 Mar 2024 02:00:00 GMT"
recurrence:
pattern:
type: "Daily"
interval: 1
range:
type: "Numbered"
numberOfOccurrences: 3
```
To create a recurrence rule, you need to specify 3 parts: `start`, `end` and `recurrence`.
The `start` and `end` parameters define the time window which need to recur periodically.
The `recurrence` parameter is made up of two parts: `pattern` (how often the time window will repeat) and `range` (for how long the recurrence pattern will repeat). To create a recurrence rule, you must specify both `pattern` and `range`. Any pattern type can work with any range type.
The time zone offset of the `start` property will apply to the recurrence settings.
**Note:** `start` must be a valid first occurrence which fits the recurrence pattern. For example, if we define to repeat on every other Monday and Tuesday, then the start time should be in Monday or Tuesday. <br /> Additionally, the duration of the time window cannot be longer than how frequently it occurs. For example, it is invalid to have a 25-hour time window recur every day.
#### Recurrence Pattern
There are two possible recurrence pattern types: `Daily` and `Weekly`.
`Daily` causes an event to repeat based on a number of days between each occurrence. For example, "every day" or "every 3 days".
`Weekly` causes an event to repeat on the same day or days of the week, based on the number of weeks between each set of occurrences. For example, "every Monday" or "every other Friday".
* Parameters
Property | Relevance | Description
-----------|-------|-----
**type** | Required | `Daily`/`Weekly`.
**interval** | Optional | Specifies the interval between each start time of occurrence. Default value is 1. <br/>For example, if the interval is 2 with `Daily` type, and current occurrence is 2:00 AM ~ 3:00 AM on 2024/05/11, then the next occurrence should be 2:00 AM ~ 3:00 AM on 2024/05/13
**daysOfWeek** | Required/Optional | Specifies on which day(s) of the week the event occurs. It's required when `Weekly` type, negatively for `Daily` type.
**firstDayOfWeek** | Optional | Specifies which day is considered the first day of the week. Default value is `Sunday`. Negatively for `Daily` type.
* Example
* Daily
The following example will repeat from 2:00 AM to 3:00 AM on every 2 days
```yaml
start: "Mon, 13 May 2024 02:00:00 GMT"
end: "Mon, 13 May 2024 03:00:00 GMT"
recurrence:
pattern:
type: "Daily"
interval: 2
range:
type: "NoEnd"
```
* Weekly
The following example will repeat from 2:00 AM to 3:00 AM on every other Monday and Tuesday
```yaml
start: "Mon, 13 May 2024 02:00:00 GMT"
end: "Mon, 13 May 2024 03:00:00 GMT"
recurrence:
pattern:
type: "Weekly"
interval: 2
daysOfWeek:
- Monday
- Tuesday
range:
type: "NoEnd"
```
The following example shows a time window starts on one day and ends on another, repeat every week.
```yaml
start: "Mon, 13 May 2024 02:00:00 GMT"
end: "Mon, 14 May 2024 03:00:00 GMT"
recurrence:
pattern:
type: "Weekly"
interval: 1
daysOfWeek:
- Monday
range:
type: "NoEnd"
```
#### Recurrence Range
There are three possible recurrence range type: `NoEnd`, `EndDate` and `Numbered`.
* Parameter
Property | Relevance | Description |
-----------|---------------|-------------
**type** | Required | `NoEnd`/`EndDate`/`Numbered`.
**endDate** | Required/Optional | Specifies the date time to stop applying the pattern. Note that as long as the start time of the last occurrence falls before the end date, the end time of that occurrence is allowed to extend beyond it. <br /> It's required for `EndDate` type, negatively for `NoEnd` and `Numbered` type.
**NumberOfOccurrences** | Required/Optional | Specifies the number of days that it will occur. <br /> It's required for `Numbered` type, negatively for `NoEnd` and `EndDate` type.
* Example
* `NoEnd`
The `NoEnd` range causes the recurrence to occur indefinitely.
The following example will repeat from 6:00 PM to 8:00 PM every day.
``` yaml
start: "Fri, 22 Mar 2024 18:00:00 GMT"
end: "Fri, 22 Mar 2024 20:00:00 GMT"
recurrence:
pattern:
type: "Daily"
interval: 1
range:
type: "NoEnd"
```
* `EndDate`
The `EndDate` range causes the time window to occur on all days that fit the applicable pattern until the end date.
The following example will repeat from 6:00 PM to 8:00 PM every day until the last occurrence happens on April 1st, 2024.
``` yaml
start: "Fri, 22 Mar 2024 18:00:00 GMT"
end: "Fri, 22 Mar 2024 20:00:00 GMT"
recurrence:
pattern:
type: "Daily"
interval: 1
range:
type: "EndDate"
endDate: "Mon, 1 Apr 2024 20:00:00 GMT"
```
* `Numbered`
The `Numbered` range causes the time window to occur a fixed number of days (based on the pattern).
The following example will repeat from 6:00 PM to 8:00 PM on Monday and Tuesday until the there are 3 occurrences, which respectively happens on 2024/04/01(Mon), 2024/04/02(Tue) and 2024/04/08(Mon).
``` yaml
start: "Mon, 1 Apr 2024 18:00:00 GMT"
end: "Mon, 1 Apr 2024 20:00:00 GMT"
recurrence:
pattern:
type: "Weekly"
interval: 1
daysOfWeek:
- Monday
- Tuesday
range:
type: "Numbered"
numberOfOccurrences: 3
```
### TargetingFilter
This filter provides the capability to enable a feature for a target audience. An in-depth explanation of targeting is explained in the targeting section below. The filter parameters include an audience object which describes users, groups, and a default percentage of the user base that should have access to the feature, and an exclusion object for users and groups that should never be targeted. Each group object that is listed in the target audience must also specify what percentage of the group's members should have access. If a user is specified in the users section directly, or if the user is in the included percentage of any of the group rollouts, or if the user falls into the default rollout percentage then that user will have the feature enabled.

Просмотреть файл

@ -1,12 +1,12 @@
---
title:
keywords: Azure, java, SDK, API, spring-cloud-azure-feature-management-web, spring
ms.date: 05/10/2024
ms.date: 09/10/2024
ms.topic: reference
ms.devlang: java
ms.service: spring
---
# Spring Cloud for Azure feature management web client library for Java
See: [Spring Cloud Azure Feature Management](https://github.com/Azure/azure-sdk-for-java/tree/spring-cloud-azure-feature-management-web_5.12.0/sdk/spring/spring-cloud-azure-feature-management)
See: [Spring Cloud Azure Feature Management](https://github.com/Azure/azure-sdk-for-java/tree/spring-cloud-azure-feature-management-web_5.16.0/sdk/spring/spring-cloud-azure-feature-management)

Просмотреть файл

@ -1,12 +1,12 @@
---
title: Azure Spring Data Cosmos client library for Java
keywords: Azure, java, SDK, API, azure-spring-data-cosmos, spring
ms.date: 06/06/2024
ms.date: 09/10/2024
ms.topic: reference
ms.devlang: java
ms.service: spring
---
# Azure Spring Data Cosmos client library for Java - version 3.46.0
# Azure Spring Data Cosmos client library for Java - version 5.16.0
**Azure Spring Data Cosmos** provides Spring Data support for Azure Cosmos DB using the [SQL API][sql_api_query], based on Spring Data framework.
@ -67,13 +67,13 @@ Mapping from **Spring Boot** / **Spring Cloud** version to **Azure Spring Data C
| 2.4.x | 2020.0.x | 3.5.0 - 3.7.0 |
### I'm Using Spring Boot Version X
If you are using **Spring Boot** in your project, you can find related **Azure Spring Data Cosmos** versions from above table. For example: if you are using **Spring Boot** 2.7.x, you should use **Azure Spring Data Cosmos** versions 3.23.0 and above.
If you are using **Spring Boot** in your project, you can find related **Azure Spring Data Cosmos** versions from above table. For example: if you are using **Spring Boot** 3.0.x, you should use **Azure Spring Data Cosmos** versions 5.3.0 and above.
### I'm Using Spring Cloud Version Y
If you are using **Spring Cloud** in your project, you can also find related **Azure Spring Data Cosmos** versions from above table. For example, if you are using **Spring Cloud** 2021.0.x, you should use **Azure Spring Data Cosmos** versions 3.23.0 and above.
If you are using **Spring Cloud** in your project, you can also find related **Azure Spring Data Cosmos** versions from above table. For example, if you are using **Spring Cloud** 2022.0.x, you should use **Azure Spring Data Cosmos** versions 5.3.0 and above.
## Spring Data Version Support
This project supports `spring-data-commons 2.7.x` versions.
This project supports `spring-data-commons 3.0.x` versions.
The above setup does not allow you to override individual dependencies using a property as explained above. To achieve the same result, youd need to add an entry in the dependencyManagement of your project before the `spring-boot-dependencies` entry. For instance, to upgrade to another Spring Data release train youd add the following to your pom.xml.
```xml
@ -109,7 +109,7 @@ If you are using Maven, add the following dependency.
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-spring-data-cosmos</artifactId>
<version>3.46.0</version>
<version>5.16.0</version>
</dependency>
```
[//]: # ({x-version-update-end})
@ -312,7 +312,7 @@ public CosmosConfig cosmosConfig() {
- Containers will be created automatically unless you don't want them to. Set `autoCreateContainer` to false in `@Container` annotation to disable auto creation of containers.
- Note: If you are using provisioned throughput, you can optionally specify different ru values to customize request units for the container created by the SDK. The minimum ru should be 400
- Note: By default request units assigned to newly created containers is 400. Specify different ru value to customize request units for the container created by the SDK (minimum RU value is 400).
```java readme-sample-User
@Container(containerName = "myContainer", ru = "400")
public class User {
@ -385,7 +385,7 @@ public class UserSample {
- Azure Spring Data Cosmos supports nested partition key. To add nested partition key, use `partitionKeyPath` field in `@Container` annotation.
- `partitionKeyPath` should only be used to support nested partition key path. For general partition key support, use the `@PartitionKey` annotation.
- By default `@PartitionKey` annotation will take precedence, unless not specified.
- Below example shows how to properly use Nested Partition key feature.
- Below example shows how to properly use Nested Partition Key feature.
```java readme-sample-NestedPartitionKeyEntitySample
@Container(containerName = "nested-partition-key", partitionKeyPath = "/nestedEntitySample/nestedPartitionKey")
@ -401,6 +401,29 @@ public class NestedEntitySample {
}
```
#### Hierarchical Partition Key support
- Azure Spring Data Cosmos supports hierarchical partition key. To add hierarchical partition key, use `hierarchicalPartitionKeyPaths` field in `@Container` annotation.
- `hierarchicalPartitionKeyPaths` should only be used to support hierarchical partition keys. For general partition key support, use the `@PartitionKey` annotation.
- By default `@PartitionKey` annotation will take precedence, unless not specified.
- Below example shows how to properly use Hierarchical Partition Key feature.
```java readme-sample-HierarchicalPartitionKeyEntitySample
@Container(containerName = "hierarchical-partition-key", hierarchicalPartitionKeyPaths = {"/id", "/firstName", "/lastName"})
public class HierarchicalPartitionKeyEntitySample {
private HierarchicalEntitySample hierarchicalEntitySample;
}
```
```java readme-sample-HierarchicalEntitySample
public class HierarchicalEntitySample {
private String id;
private String firstName;
private String lastName;
}
```
### Create repositories
Extends CosmosRepository interface, which provides Spring Data repository support.
@ -727,7 +750,7 @@ azure.cosmos.secondary.populateQueryMetrics=if-populate-query-metrics
azure.cosmos.secondary.populateIndexMetrics=if-populate-index-metrics
```
- The [Entity](https://github.com/Azure/azure-sdk-for-java/tree/azure-spring-data-cosmos_3.46.0/sdk/spring/azure-spring-data-cosmos#define-an-entity) and [Repository](https://github.com/Azure/azure-sdk-for-java/tree/azure-spring-data-cosmos_3.46.0/sdk/spring/azure-spring-data-cosmos#create-repositories) definition is similar as above. You can put different database entities into different packages.
- The [Entity](https://github.com/Azure/azure-sdk-for-java/tree/azure-spring-data-cosmos_5.16.0/sdk/spring/azure-spring-data-cosmos#define-an-entity) and [Repository](https://github.com/Azure/azure-sdk-for-java/tree/azure-spring-data-cosmos_5.16.0/sdk/spring/azure-spring-data-cosmos#create-repositories) definition is similar as above. You can put different database entities into different packages.
- The `@EnableReactiveCosmosRepositories` or `@EnableCosmosRepositories` support user-define the cosmos template, use `reactiveCosmosTemplateRef` or `cosmosTemplateRef` to config the name of the `ReactiveCosmosTemplate` or `CosmosTemplate` bean to be used with the repositories detected.
- If you have multiple cosmos database accounts, you can define multiple `CosmosAsyncClient`. If the single cosmos account has multiple databases, you can use the same `CosmosAsyncClient` to initialize the cosmos template.
@ -785,7 +808,7 @@ public class SecondaryDatasourceConfiguration {
public CosmosAsyncClient getCosmosAsyncClient(@Qualifier("secondary") CosmosProperties secondaryProperties) {
return CosmosFactory.createCosmosAsyncClient(new CosmosClientBuilder()
.key(secondaryProperties.getKey())
.endpoint(secondaryProperties.getUri());
.endpoint(secondaryProperties.getUri()));
}
@Bean("secondaryCosmosConfig")
@ -824,7 +847,7 @@ public class SecondaryDatasourceConfiguration {
public CosmosAsyncClient getCosmosAsyncClient(@Qualifier("secondary") CosmosProperties secondaryProperties) {
return CosmosFactory.createCosmosAsyncClient(new CosmosClientBuilder()
.key(secondaryProperties.getKey())
.endpoint(secondaryProperties.getUri());
.endpoint(secondaryProperties.getUri()));
}
@Bean("secondaryCosmosConfig")
@ -924,7 +947,7 @@ azure.cosmos.database=your-cosmosDb-dbName
azure.cosmos.populate-query-metrics=if-populate-query-metrics
```
- The [Entity](https://github.com/Azure/azure-sdk-for-java/tree/azure-spring-data-cosmos_3.46.0/sdk/spring/azure-spring-data-cosmos#define-an-entity) and [Repository](https://github.com/Azure/azure-sdk-for-java/tree/azure-spring-data-cosmos_3.46.0/sdk/spring/azure-spring-data-cosmos#create-repositories) definition is similar as above. You can put different database entities into different packages.
- The [Entity](https://github.com/Azure/azure-sdk-for-java/tree/azure-spring-data-cosmos_5.16.0/sdk/spring/azure-spring-data-cosmos#define-an-entity) and [Repository](https://github.com/Azure/azure-sdk-for-java/tree/azure-spring-data-cosmos_5.16.0/sdk/spring/azure-spring-data-cosmos#create-repositories) definition is similar as above. You can put different database entities into different packages.
- You can use `EnableReactiveCosmosRepositories` with different `reactiveCosmosTemplateRef` to define multiple databases in single cosmos account.
```java
@ -1061,7 +1084,7 @@ public class MultiTenantDBCosmosFactory extends CosmosFactory {
## Beta version package
Beta version built from `main` branch are available, you can refer to the [instruction](https://github.com/Azure/azure-sdk-for-java/blob/azure-spring-data-cosmos_3.46.0/CONTRIBUTING.md#nightly-package-builds) to use beta version packages.
Beta version built from `main` branch are available, you can refer to the [instruction](https://github.com/Azure/azure-sdk-for-java/blob/azure-spring-data-cosmos_5.16.0/CONTRIBUTING.md#nightly-package-builds) to use beta version packages.
## Troubleshooting
@ -1132,7 +1155,7 @@ or contact [opencode@microsoft.com][coc_contact] with any additional questions o
[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/
[coc_contact]: mailto:opencode@microsoft.com
[azure_subscription]: https://azure.microsoft.com/free/
[samples]: https://github.com/Azure/azure-sdk-for-java/tree/azure-spring-data-cosmos_3.46.0/sdk/spring/azure-spring-data-cosmos/src/samples/java/com/azure/spring/data/cosmos
[samples]: https://github.com/Azure/azure-sdk-for-java/tree/azure-spring-data-cosmos_5.16.0/sdk/spring/azure-spring-data-cosmos/src/samples/java/com/azure/spring/data/cosmos
[sample-for-multi-database]: https://github.com/Azure-Samples/azure-spring-boot-samples/tree/spring-cloud-azure_v4.3.0/cosmos/azure-spring-data-cosmos/cosmos-multi-database-multi-account
[sample-for-multi-database-single-account]: https://github.com/Azure-Samples/azure-spring-boot-samples/tree/spring-cloud-azure_v4.3.0/cosmos/azure-spring-data-cosmos/cosmos-multi-database-single-account
[sql_api_query]: /azure/cosmos-db/sql-api-sql-query
@ -1140,7 +1163,7 @@ or contact [opencode@microsoft.com][coc_contact] with any additional questions o
[local_emulator_export_ssl_certificates]: /azure/cosmos-db/local-emulator-export-ssl-certificates
[spring_data_commons_id_annotation]: https://github.com/spring-projects/spring-data-commons/blob/main/src/main/java/org/springframework/data/annotation/Id.java
[azure_cosmos_db_partition]: /azure/cosmos-db/partition-data
[address_repository_it_test]: https://github.com/Azure/azure-sdk-for-java/blob/azure-spring-data-cosmos_3.46.0/sdk/spring/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/integration/AddressRepositoryIT.java
[address_repository_it_test]: https://github.com/Azure/azure-sdk-for-java/blob/azure-spring-data-cosmos_5.16.0/sdk/spring/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/integration/AddressRepositoryIT.java
[azure_spring_data_cosmos_docs]: /azure/cosmos-db/sql-api-sdk-java-spring-v3
[spring_data_custom_query]: https://docs.spring.io/spring-data/commons/docs/current/reference/html/#repositories.query-methods.details
[sql_queries_in_cosmos]: /azure/cosmos-db/tutorial-query-sql-api

Просмотреть файл

@ -1,6 +1,6 @@
{
"Name": "azure-spring-data-cosmos",
"Version": "3.46.0",
"Version": "5.16.0",
"DevVersion": null,
"DirectoryPath": "sdk/spring/azure-spring-data-cosmos",
"ServiceDirectory": "spring",
@ -10,7 +10,8 @@
"SdkType": "spring",
"IsNewSdk": true,
"ArtifactName": "azure-spring-data-cosmos",
"ReleaseStatus": "2024-06-03",
"ReleaseStatus": "2024-09-09",
"AdditionalValidationPackages": null,
"Namespaces": [
"com.azure.spring.data.cosmos",
"com.azure.spring.data.cosmos.common",

Просмотреть файл

@ -1,6 +1,6 @@
{
"Name": "spring-cloud-azure-appconfiguration-config",
"Version": "5.12.0",
"Version": "5.16.0",
"DevVersion": null,
"DirectoryPath": "sdk/spring/spring-cloud-azure-appconfiguration-config",
"ServiceDirectory": "spring",
@ -10,7 +10,8 @@
"SdkType": "spring",
"IsNewSdk": true,
"ArtifactName": "spring-cloud-azure-appconfiguration-config",
"ReleaseStatus": "2024-05-09",
"ReleaseStatus": "2024-09-09",
"AdditionalValidationPackages": null,
"Namespaces": [
"com.azure.spring.cloud.appconfiguration.config"
]

Просмотреть файл

@ -1,6 +1,6 @@
{
"Name": "spring-cloud-azure-feature-management-web",
"Version": "5.12.0",
"Version": "5.16.0",
"DevVersion": null,
"DirectoryPath": "sdk/spring/spring-cloud-azure-feature-management-web",
"ServiceDirectory": "spring",
@ -10,7 +10,8 @@
"SdkType": "spring",
"IsNewSdk": true,
"ArtifactName": "spring-cloud-azure-feature-management-web",
"ReleaseStatus": "2024-05-09",
"ReleaseStatus": "2024-09-09",
"AdditionalValidationPackages": null,
"Namespaces": [
"com.azure.spring.cloud.feature.management.web"
]

Просмотреть файл

@ -1,6 +1,6 @@
{
"Name": "spring-cloud-azure-feature-management",
"Version": "5.12.0",
"Version": "5.16.0",
"DevVersion": null,
"DirectoryPath": "sdk/spring/spring-cloud-azure-feature-management",
"ServiceDirectory": "spring",
@ -10,7 +10,8 @@
"SdkType": "spring",
"IsNewSdk": true,
"ArtifactName": "spring-cloud-azure-feature-management",
"ReleaseStatus": "2024-05-09",
"ReleaseStatus": "2024-09-09",
"AdditionalValidationPackages": null,
"Namespaces": [
"com.azure.spring.cloud.feature.management",
"com.azure.spring.cloud.feature.management.filters",