Skip to content

Commit 57843f3

Browse files
author
SDKAuto
committed
CodeGen from PR 33698 in Azure/azure-rest-api-specs
Merge d82f6698c1524f8ad485970035643563a8889fb5 into f03aa628f37d2d7e10db8cc16e7471342d3beaaf
1 parent 61f4f9b commit 57843f3

File tree

60 files changed

+1960
-7933
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+1960
-7933
lines changed

sdk/schemaregistry/azure-data-schemaregistry/CHANGELOG.md

Lines changed: 2 additions & 422 deletions
Large diffs are not rendered by default.
Lines changed: 38 additions & 181 deletions
Original file line numberDiff line numberDiff line change
@@ -1,221 +1,78 @@
1-
# Azure Schema Registry client library for Java
1+
# Azure SchemaRegistry client library for Java
22

3-
Azure Schema Registry is a schema repository service hosted by Azure Event Hubs, providing schema storage, versioning,
4-
and management. The registry is leveraged by applications to reduce payload size while describing payload structure with
5-
schema identifiers rather than full schemas.
3+
Azure SchemaRegistry client library for Java.
64

7-
[Source code][source_code] | [Package (Maven)][package_maven] | [API reference documentation][api_reference_doc] | [Product Documentation][product_documentation] | [Samples][sample_readme]
5+
This package contains Microsoft Azure SchemaRegistry client library.
86

9-
## Getting started
10-
11-
### Prerequisites
7+
## Documentation
128

13-
- A [Java Development Kit (JDK)][jdk_link], version 8 or later.
14-
- [Azure Subscription][azure_subscription]
15-
- An [Event Hubs schema registry][event_hubs_namespace]
16-
17-
### Include the package
9+
Various documentation is available to help you get started
1810

19-
#### Include the BOM file
11+
- [API reference documentation][docs]
12+
- [Product documentation][product_documentation]
2013

21-
Please include the azure-sdk-bom to your project to take dependency on the General Availability (GA) version of the library. In the following snippet, replace the {bom_version_to_target} placeholder with the version number.
22-
To learn more about the BOM, see the [AZURE SDK BOM README](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/boms/azure-sdk-bom/README.md).
14+
## Getting started
2315

24-
```xml
25-
<dependencyManagement>
26-
<dependencies>
27-
<dependency>
28-
<groupId>com.azure</groupId>
29-
<artifactId>azure-sdk-bom</artifactId>
30-
<version>{bom_version_to_target}</version>
31-
<type>pom</type>
32-
<scope>import</scope>
33-
</dependency>
34-
</dependencies>
35-
</dependencyManagement>
36-
```
37-
and then include the direct dependency in the dependencies section without the version tag as shown below.
16+
### Prerequisites
3817

39-
```xml
40-
<dependencies>
41-
<dependency>
42-
<groupId>com.azure</groupId>
43-
<artifactId>azure-data-schemaregistry</artifactId>
44-
</dependency>
45-
</dependencies>
46-
```
18+
- [Java Development Kit (JDK)][jdk] with version 8 or above
19+
- [Azure Subscription][azure_subscription]
4720

48-
#### Include direct dependency
49-
If you want to take dependency on a particular version of the library that is not present in the BOM,
50-
add the direct dependency to your project as follows.
21+
### Adding the package to your product
5122

5223
[//]: # ({x-version-update-start;com.azure:azure-data-schemaregistry;current})
5324
```xml
54-
<dependency>
55-
<groupId>com.azure</groupId>
56-
<artifactId>azure-data-schemaregistry</artifactId>
57-
<version>1.6.0-beta.1</version>
58-
</dependency>
59-
```
60-
[//]: # ({x-version-update-end})
61-
62-
### Authenticate the client
63-
In order to interact with the Azure Schema Registry service, you'll need to create an instance of the
64-
`SchemaRegistryClient` class through the `SchemaRegistryClientBuilder`. You will need an **endpoint** and an
65-
**API key** to instantiate a client object.
66-
67-
#### Create SchemaRegistryClient with Azure Active Directory Credential
68-
69-
You can authenticate with Azure Active Directory using the [Azure Identity library][azure_identity]. Note that regional endpoints do not support AAD authentication. Create a [custom subdomain][custom_subdomain] for your resource in order to use this type of authentication.
70-
71-
To use the [DefaultAzureCredential][DefaultAzureCredential] provider shown below, or other credential providers provided with the Azure SDK, please include the `azure-identity` package:
72-
73-
[//]: # ({x-version-update-start;com.azure:azure-identity;dependency})
74-
```xml
7525
<dependency>
7626
<groupId>com.azure</groupId>
77-
<artifactId>azure-identity</artifactId>
78-
<version>1.15.3</version>
27+
<artifactId>azure-data-schemaregistry</artifactId>
28+
<version>1.0.0-beta.1</version>
7929
</dependency>
8030
```
31+
[//]: # ({x-version-update-end})
8132

82-
You will also need to [register a new AAD application][register_aad_app] and [grant access][aad_grant_access] to
83-
Schema Registry service.
84-
85-
Set the values of the client ID, tenant ID, and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, AZURE_CLIENT_SECRET.
86-
87-
##### Async client
88-
89-
```java com.azure.data.schemaregistry.schemaregistryasyncclient.construct
90-
DefaultAzureCredential azureCredential = new DefaultAzureCredentialBuilder()
91-
.build();
92-
SchemaRegistryAsyncClient client = new SchemaRegistryClientBuilder()
93-
.fullyQualifiedNamespace("https://<your-schema-registry-endpoint>.servicebus.windows.net")
94-
.credential(azureCredential)
95-
.buildAsyncClient();
96-
```
97-
98-
##### Sync client
33+
### Authentication
9934

100-
```java com.azure.data.schemaregistry.schemaregistryclient.construct
101-
DefaultAzureCredential azureCredential = new DefaultAzureCredentialBuilder()
102-
.build();
103-
SchemaRegistryClient client = new SchemaRegistryClientBuilder()
104-
.fullyQualifiedNamespace("https://<your-schema-registry-endpoint>.servicebus.windows.net")
105-
.credential(azureCredential)
106-
.buildClient();
107-
```
35+
[Azure Identity][azure_identity] package provides the default implementation for authenticating the client.
10836

10937
## Key concepts
110-
### Schemas
111-
112-
A schema has 6 components:
113-
- Group Name: The name of the group of schemas in the Schema Registry instance.
114-
- Schema Name: The name of the schema.
115-
- Schema ID: The ID assigned by the Schema Registry instance for the schema.
116-
- Serialization Type: The format used for serialization of the schema. For example, Avro.
117-
- Schema Content: The string representation of the schema.
118-
- Schema Version: The version assigned to the schema in the Schema Registry instance.
119-
120-
These components play different roles. Some are used as input into the operations and some are outputs. Currently,
121-
[SchemaProperties][schema_properties] only exposes those properties that are potential outputs that are used in
122-
SchemaRegistry operations. Those exposed properties are `Content` and `Id`.
12338

12439
## Examples
12540

126-
* [Register a schema](#register-a-schema)
127-
* [Retrieve a schema's properties](#retrieve-a-schemas-properties)
128-
* [Retrieve a schema](#retrieve-a-schema)
129-
130-
### Register a schema
131-
Register a schema to be stored in the Azure Schema Registry.
132-
133-
```java com.azure.data.schemaregistry.schemaregistryclient.registerschema-avro
134-
String schema = "{\"type\":\"enum\",\"name\":\"TEST\",\"symbols\":[\"UNIT\",\"INTEGRATION\"]}";
135-
SchemaProperties properties = client.registerSchema("{schema-group}", "{schema-name}", schema,
136-
SchemaFormat.AVRO);
137-
138-
System.out.printf("Schema id: %s, schema format: %s%n", properties.getId(), properties.getFormat());
41+
```java com.azure.data.schemaregistry.readme
13942
```
14043

141-
### Retrieve a schema's properties
142-
Retrieve a previously registered schema's properties from the Azure Schema Registry.
44+
### Service API versions
14345

144-
```java com.azure.data.schemaregistry.schemaregistryclient.getschema
145-
SchemaRegistrySchema schema = client.getSchema("{schema-id}");
46+
The client library targets the latest service API version by default.
47+
The service client builder accepts an optional service API version parameter to specify which API version to communicate.
14648

147-
System.out.printf("Schema id: %s, schema format: %s%n", schema.getProperties().getId(),
148-
schema.getProperties().getFormat());
149-
System.out.println("Schema contents: " + schema.getDefinition());
150-
```
49+
#### Select a service API version
15150

152-
### Retrieve a schema
153-
Retrieve a previously registered schema's content and properties from the Azure Schema Registry.
154-
155-
```java com.azure.data.schemaregistry.schemaregistryclient.getschemaproperties
156-
String schemaContent = "{\n"
157-
+ " \"type\" : \"record\", \n"
158-
+ " \"namespace\" : \"SampleSchemaNameSpace\", \n"
159-
+ " \"name\" : \"Person\", \n"
160-
+ " \"fields\" : [\n"
161-
+ " { \n"
162-
+ " \"name\" : \"FirstName\" , \"type\" : \"string\" \n"
163-
+ " }, \n"
164-
+ " { \n"
165-
+ " \"name\" : \"LastName\", \"type\" : \"string\" \n"
166-
+ " }\n"
167-
+ " ]\n"
168-
+ "}";
169-
SchemaProperties properties = client.getSchemaProperties("{schema-group}", "{schema-name}",
170-
schemaContent, SchemaFormat.AVRO);
171-
172-
System.out.println("Schema id: " + properties.getId());
173-
System.out.println("Format: " + properties.getFormat());
174-
System.out.println("Version: " + properties.getVersion());
175-
```
51+
You have the flexibility to explicitly select a supported service API version when initializing a service client via the service client builder.
52+
This ensures that the client can communicate with services using the specified API version.
17653

177-
## Troubleshooting
54+
When selecting an API version, it is important to verify that there are no breaking changes compared to the latest API version.
55+
If there are significant differences, API calls may fail due to incompatibility.
17856

179-
### Enabling Logging
57+
Always ensure that the chosen API version is fully supported and operational for your specific use case and that it aligns with the service's versioning policy.
18058

181-
Azure SDKs for Java offer a consistent logging story to help aid in troubleshooting application errors and expedite
182-
their resolution. The logs produced will capture the flow of an application before reaching the terminal state to help
183-
locate the root issue. View the [logging][logging] wiki for guidance about enabling logging.
59+
## Troubleshooting
18460

18561
## Next steps
186-
More samples can be found [here][samples].
18762

18863
## Contributing
18964

190-
This project welcomes contributions and suggestions. Most contributions require you to agree to a [Contributor License Agreement (CLA)][cla] declaring that you have the right to, and actually do, grant us the rights to use your contribution.
191-
192-
When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.
65+
For details on contributing to this repository, see the [contributing guide](https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md).
19366

194-
This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For more information see the [Code of Conduct FAQ][coc_faq] or contact [[email protected]][coc_contact] with any additional questions or comments.
67+
1. Fork it
68+
1. Create your feature branch (`git checkout -b my-new-feature`)
69+
1. Commit your changes (`git commit -am 'Add some feature'`)
70+
1. Push to the branch (`git push origin my-new-feature`)
71+
1. Create new Pull Request
19572

19673
<!-- LINKS -->
197-
[package_maven]: https://central.sonatype.com/artifact/com.azure/azure-data-schemaregistry
198-
[sample_readme]: https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/schemaregistry/azure-data-schemaregistry/src/samples
199-
[samples]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/schemaregistry/azure-data-schemaregistry/src/samples/java/com/azure/data/schemaregistry
200-
[source_code]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/schemaregistry/azure-data-schemaregistry/src
201-
[samples_code]: src/samples/
74+
[product_documentation]: https://azure.microsoft.com/services/
75+
[docs]: https://azure.github.io/azure-sdk-for-java/
76+
[jdk]: https://learn.microsoft.com/azure/developer/java/fundamentals/
20277
[azure_subscription]: https://azure.microsoft.com/free/
203-
[api_reference_doc]: https://azure.github.io/azure-sdk-for-java/
204-
[azure_cli]: https://learn.microsoft.com/cli/azure
205-
[azure_portal]: https://portal.azure.com
206-
[azure_identity]: https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/identity/azure-identity
207-
[DefaultAzureCredential]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity/README.md#defaultazurecredential
208-
[event_hubs_namespace]: https://learn.microsoft.com/azure/event-hubs/create-schema-registry
209-
[jdk_link]: https://learn.microsoft.com/java/azure/jdk/?view=azure-java-stable
210-
[product_documentation]: https://aka.ms/schemaregistry
211-
[custom_subdomain]: https://learn.microsoft.com/azure/cognitive-services/authentication#create-a-resource-with-a-custom-subdomain
212-
[register_aad_app]: https://learn.microsoft.com/azure/cognitive-services/authentication#assign-a-role-to-a-service-principal
213-
[aad_grant_access]: https://learn.microsoft.com/azure/cognitive-services/authentication#assign-a-role-to-a-service-principal
214-
[schema_properties]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/schemaregistry/azure-data-schemaregistry/src/main/java/com/azure/data/schemaregistry/models/SchemaProperties.java
215-
[logging]: https://github.com/Azure/azure-sdk-for-java/wiki/Logging-in-Azure-SDK
216-
[cla]: https://cla.microsoft.com
217-
[coc]: https://opensource.microsoft.com/codeofconduct/
218-
[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/
219-
[coc_contact]: mailto:[email protected]
220-
221-
78+
[azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity
Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1 @@
1-
{
2-
"AssetsRepo": "Azure/azure-sdk-assets",
3-
"AssetsRepoPrefixPath": "java",
4-
"TagPrefix": "java/schemaregistry/azure-data-schemaregistry",
5-
"Tag": "java/schemaregistry/azure-data-schemaregistry_1eb85e2a8b"
6-
}
1+
{"AssetsRepo":"Azure/azure-sdk-assets","AssetsRepoPrefixPath":"java","TagPrefix":"java/schemaregistry/azure-data-schemaregistry","Tag":""}

sdk/schemaregistry/azure-data-schemaregistry/checkstyle-suppressions.xml

Lines changed: 0 additions & 6 deletions
This file was deleted.

sdk/schemaregistry/azure-data-schemaregistry/pom.xml

Lines changed: 24 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
<!--
2-
~ Copyright (c) Microsoft Corporation. All rights reserved.
3-
~ Licensed under the MIT License.
4-
-->
5-
6-
<project xmlns="http://maven.apache.org/POM/4.0.0"
7-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
2+
~ Copyright (c) Microsoft Corporation. All rights reserved.
3+
~ Licensed under the MIT License.
4+
~ Code generated by Microsoft (R) TypeSpec Code Generator.
5+
-->
6+
<project xmlns="http://maven.apache.org/POM/4.0.0" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
87
<modelVersion>4.0.0</modelVersion>
9-
108
<parent>
119
<groupId>com.azure</groupId>
1210
<artifactId>azure-client-sdk-parent</artifactId>
@@ -16,42 +14,36 @@
1614

1715
<groupId>com.azure</groupId>
1816
<artifactId>azure-data-schemaregistry</artifactId>
17+
<version>1.0.0-beta.1</version> <!-- {x-version-update;com.azure:azure-data-schemaregistry;current} -->
1918
<packaging>jar</packaging>
20-
<version>1.6.0-beta.1</version> <!-- {x-version-update;com.azure:azure-data-schemaregistry;current} -->
2119

22-
<name>Microsoft Azure client library for Schema Registry</name>
23-
<description>This package contains the Microsoft Azure Schema Registry client library</description>
20+
<name>Microsoft Azure SDK for SchemaRegistry</name>
21+
<description>This package contains Microsoft Azure SchemaRegistry client library.</description>
2422
<url>https://github.com/Azure/azure-sdk-for-java</url>
2523

26-
<distributionManagement>
27-
<site>
28-
<id>azure-java-build-docs</id>
29-
<url>${site.url}/site/${project.artifactId}</url>
30-
</site>
31-
</distributionManagement>
24+
<licenses>
25+
<license>
26+
<name>The MIT License (MIT)</name>
27+
<url>http://opensource.org/licenses/MIT</url>
28+
<distribution>repo</distribution>
29+
</license>
30+
</licenses>
3231

3332
<scm>
34-
<url>scm:git:https://github.com/Azure/azure-sdk-for-java</url>
33+
<url>https://github.com/Azure/azure-sdk-for-java</url>
3534
<connection>scm:git:[email protected]:Azure/azure-sdk-for-java.git</connection>
35+
<developerConnection>scm:git:[email protected]:Azure/azure-sdk-for-java.git</developerConnection>
3636
<tag>HEAD</tag>
3737
</scm>
38-
38+
<developers>
39+
<developer>
40+
<id>microsoft</id>
41+
<name>Microsoft</name>
42+
</developer>
43+
</developers>
3944
<properties>
40-
<!-- Configures the Java 9+ run to perform the required module exports, opens, and reads that are necessary for testing but shouldn't be part of the module-info. -->
41-
<javaModulesSurefireArgLine>
42-
--add-opens com.azure.core/com.azure.core.implementation.util=ALL-UNNAMED
43-
--add-opens com.azure.data.schemaregistry/com.azure.data.schemaregistry=ALL-UNNAMED
44-
45-
--add-exports com.azure.core/com.azure.core.implementation.util=ALL-UNNAMED
46-
--add-exports com.azure.data.schemaregistry/com.azure.data.schemaregistry.implementation.models=ALL-UNNAMED
47-
</javaModulesSurefireArgLine>
48-
<checkstyle.excludes>**/implementation/**/*.java</checkstyle.excludes>
49-
50-
<checkstyle.suppressionsLocation>checkstyle-suppressions.xml</checkstyle.suppressionsLocation>
51-
<spotbugs.skip>false</spotbugs.skip>
52-
<spotbugs.excludeFilterFile>spotbugs-exclude.xml</spotbugs.excludeFilterFile>
45+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
5346
</properties>
54-
5547
<dependencies>
5648
<dependency>
5749
<groupId>com.azure</groupId>
@@ -63,14 +55,6 @@
6355
<artifactId>azure-core-http-netty</artifactId>
6456
<version>1.15.11</version> <!-- {x-version-update;com.azure:azure-core-http-netty;dependency} -->
6557
</dependency>
66-
67-
<!-- Test dependencies -->
68-
<dependency>
69-
<groupId>org.apache.avro</groupId>
70-
<artifactId>avro</artifactId>
71-
<version>1.11.4</version> <!-- {x-version-update;org.apache.avro:avro;external_dependency} -->
72-
<scope>test</scope>
73-
</dependency>
7458
<dependency>
7559
<groupId>com.azure</groupId>
7660
<artifactId>azure-core-test</artifactId>

sdk/schemaregistry/azure-data-schemaregistry/resources/azure-data-schemaregistry-client.properties

Lines changed: 0 additions & 2 deletions
This file was deleted.

sdk/schemaregistry/azure-data-schemaregistry/spotbugs-exclude.xml

Lines changed: 0 additions & 22 deletions
This file was deleted.

0 commit comments

Comments
 (0)