This commit is contained in:
sima-zhu 2022-03-24 11:23:06 -07:00
Родитель cda89582c3
Коммит b5a6078148
30 изменённых файлов: 61 добавлений и 688 удалений

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

@ -50944,6 +50944,11 @@
"source_path": "docs-ref-services/latest/batchai.md ",
"redirect_url": "https://aka.ms/batchai-retirement",
"redirect_document_id": true
},
{
"source_path": "docs-ref-services/latest/batch-ai.md ",
"redirect_url": "https://aka.ms/batchai-retirement",
"redirect_document_id": true
}
]
}

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

@ -1,67 +0,0 @@
---
title: Azure App Service libraries for Java
description: Automat deployment of web apps on Azure App Service using the Azure management APIs.
keywords: Azure, Java, SDK, API, web apps , mobile , App Service
author: ramya-rao-a
ms.author: ramyar
manager: douge
ms.date: 07/09/2017
ms.topic: reference
ms.prod: azure
ms.technology: azure
ms.devlang: java
ms.service: appservice
---
# Azure App Service libraries for Java
## Overview
Deploy and manage websites, web applications, and REST APIs with [Azure App Service](/azure/app-service).
To get started with Azure App Service, see [Create your first Java web app in Azure](/azure/app-service-web/app-service-web-get-started-java).
## Management API
Deploy, scale, and configure applications in Azure App Service with the management API.
[Add a dependency](https://maven.apache.org/guides/getting-started/index.html#How_do_I_use_external_dependencies) to your Maven `pom.xml` file to use the management API in your project.
```XML
<dependency>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure-mgmt-appservice</artifactId>
<version>1.3.0</version>
</dependency>
```
> [!div class="nextstepaction"]
> [Explore the Management APIs](/java/api/overview/azure/appservice/management)
### Example
Deploy a webapp from a Docker image into an Azure Web App running on Linux.
```java
WebApp app = azure.webApps().define("newLinuxWebApp")
.withExistingLinuxPlan(myLinuxAppServicePlan)
.withExistingResourceGroup("myResourceGroup")
.withPrivateDockerHubImage("username/my-java-app")
.withCredentials("dockerHubUser","dockerHubPassword")
.withAppSetting("PORT","8080").
.create();
```
## Samples
[Deploy a web app from FTP or GitHub][1]
[Swap between app versions with deployment slots][2]
[Configure a custom domain][3]
[Scale a web app across multiple regions][4]
Explore more [sample Java code for Azure App Service](https://azure.microsoft.com/resources/samples/?platform=java&term=appservice) you can use in your apps.
[1]: ../../docs-ref-conceptual/java-sdk-configure-webapp-sources.md
[2]: https://azure.microsoft.com/resources/samples/app-service-java-manage-staging-and-production-slots-for-web-apps/
[3]: https://azure.microsoft.com/resources/samples/app-service-java-manage-web-apps-with-custom-domains/
[4]: https://azure.microsoft.com/resources/samples/app-service-java-scale-web-apps-on-linux/

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

@ -1,23 +0,0 @@
---
title: Azure Batch AI libraries for Java
description: Reference documentation for the Java Batch AI libraries
author: garyericson
ms.author: garye
ms.reviewer: routlaw
manager: douge
ms.date: 03/28/2019
ms.topic: reference
ms.prod: azure
ms.technology: azure
ms.devlang: java
ms.service: batch-ai
---
# Azure Batch AI libraries for Java
>[!Note]
>**Azure Batch AI service has been retired.** The capabilities of Azure Batch AI are now available as a managed compute target in Azure Machine Learning service. For more information, see [What's happening to Batch AI?](https://aka.ms/batchai-retirement)
## Packages
[Management](/java/api/overview/azure/batchai/management)

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

@ -1,69 +0,0 @@
---
title: Azure Cosmos DB libraries for Java
description: Reference documentation for the Java client libraries for Azure Cosmos DB
keywords: Azure, Java, SDK, API, SQL, database, MongoDB, Cosmos DB, NoSQL
author: ramya-rao-a
ms.author: ramyar
manager: douge
ms.date: 07/10/2017
ms.topic: reference
ms.prod: azure
ms.technology: azure
ms.devlang: java
ms.service: cosmos-db
---
# Azure Cosmos DB libraries for Java
## Overview
Store and query key-value, JSON document, graph, and columnar data in a globally distributed database with [Azure Cosmos DB](/azure/cosmos-db/introduction).
To get started with Azure Cosmos DB, see [Azure Cosmos DB: Build an API app with Java and the Azure portal](/azure/cosmos-db/create-sql-api-java).
## Client library
Connect to Azure Cosmos DB using the [SQL API](/azure/cosmos-db/sql-api-introduction) client library to work with JSON data with [SQL query syntax](/azure/cosmos-db/sql-api-sql-query).
[Add a dependency](https://maven.apache.org/guides/getting-started/index.html#How_do_I_use_external_dependencies) to your Maven `pom.xml` file to use the Cosmos DB client library in your project.
```XML
<dependency>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure-documentdb</artifactId>
<version>1.12.0</version>
</dependency>
```
### Example
Select matching JSON documents in Cosmos DB using SQL query syntax.
```java
DocumentClient client = new DocumentClient("https://contoso.documents.azure.com:443",
"contosoCosmosDBKey",
new ConnectionPolicy(),
ConsistencyLevel.Session);
List<Document> results = client.queryDocuments("dbs/" + DATABASE_ID + "/colls/" + COLLECTION_ID,
"SELECT * FROM myCollection WHERE myCollection.email = 'allen [at] contoso.com'",
null)
.getQueryIterable()
.toList();
```
> [!div class="nextstepaction"]
> [Explore the Client APIs](/java/api/overview/azure/cosmosdb/client)
## Samples
[Develop a Java app using Azure Cosmos DB MongoDB API][2]
[Develop a Java app using Azure Cosmos DB Graph API][3]
[Develop a Java app using Azure Cosmos DB SQL API][4]
Explore more [sample Java code for Azure Cosmos DB](https://azure.microsoft.com/resources/samples/?platform=java&term=cosmos) you can use in your apps.
[2]: https://github.com/Azure-Samples/azure-cosmos-db-mongodb-java-getting-started
[3]: https://github.com/Azure-Samples/azure-cosmos-db-graph-java-getting-started
[4]: https://github.com/Azure-Samples/azure-cosmos-db-documentdb-java-getting-started

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

@ -1,71 +0,0 @@
---
title: Azure Data Lake Analytics libraries for Java
description: Reference documentation for the Java Data Lake Analytics libraries
keywords: Azure, Java, SDK, API, big data, data lake
author: ramya-rao-a
ms.author: ramyar
manager: douge
ms.date: 06/21/2017
ms.topic: reference
ms.prod: azure
ms.technology: azure
ms.devlang: java
ms.service: data-lake-store
---
# Azure Data Lake Analytics libraries for Java
## Overview
Run big data analysis jobs that scale to massive data sets with [Azure Data Lake Analytics](/azure/data-lake-analytics/data-lake-analytics-overview).
To get started with Azure Data Lake Analytics, see [Get started with Azure Data Lake Analytics using Java SDK](/azure/data-lake-analytics/data-lake-analytics-get-started-java-sdk).
## Management API
Use the management API to manage Data Lake Analytics accounts, jobs, policies, and catalogs.
[Add a dependency](https://maven.apache.org/guides/getting-started/index.html#How_do_I_use_external_dependencies) to your Maven `pom.xml` file to use the management API in your project.
```XML
<dependency>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure-mgmt-datalake-analytics</artifactId>
<version>1.0.0-beta1.3</version>
</dependency>
```
## Example
Submit a new U-SQL job to Data Lake Analytics.
```java
// authenticate with service principal credentials
ApplicationTokenCredentials creds = new ApplicationTokenCredentials(_clientId, _tenantId, _clientSecret, null);
DataLakeAnalyticsJobManagementClient adlaJobClient = new DataLakeAnalyticsJobManagementClientImpl(creds);
// set up job parameters
UUID jobId = java.util.UUID.randomUUID();
USqlJobProperties properties = new USqlJobProperties();
properties.setScript("@input = EXTRACT Data string FROM \"/input1.csv\" USING Extractors.Csv(); OUTPUT @input TO @\"/output1.csv\" USING Outputters.Csv();");
JobInformation parameters = new JobInformation();
parameters.setName("testJob");
parameters.setJobId(jobId);
parameters.setType(JobType.USQL);
parameters.setProperties(properties);
// create the job
JobInformation jobInfo = adlaJobClient.getJobOperations().create(accountName, jobId, parameters).getBody();
```
> [!div class="nextstepaction"]
> [Explore the Management APIs](/java/api/overview/azure/datalakeanalytics/management)
## Samples
[Azure Data Lake Analytics using Java SDK][1]
[1]: https://docs.microsoft.com/azure/data-lake-analytics/data-lake-analytics-get-started-java-sdk
View the [complete list](https://azure.microsoft.com/resources/samples/?platform=java&term=analytics) of Azure Data Lake Analytics samples.

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

@ -1,103 +0,0 @@
---
title: Azure Event Grid libraries for Java
description: Reference documentation for Azure Event Grid Java libraries
keywords: Azure, Java, SDK, API, event grid, messaging, event driven
author: ramya-rao-a
ms.author: ramyar
manager: angerobe
ms.date: 07/11/2017
ms.topic: reference-reference
ms.devlang: java
ms.service: event-grid
---
# Azure Event Grid libraries for Java
Build event-driven applications that listen and react to events from Azure services and custom sources using simple HTTP-based event handling with Azure Event Grid.
[Learn more](/azure/event-grid/overview) about Azure Event Grid and get started with the [Azure Blob storage event tutorial](/azure/storage/blobs/storage-blob-event-quickstart).
## Client SDK
Create events, authenticate, and post to topics using the Azure Event Grid Client SDK.
[Add a dependency](https://maven.apache.org/guides/getting-started/index.html#How_do_I_use_external_dependencies) to your Maven `pom.xml` file to use the client library in your project.
```XML
<dependency>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure-eventgrid</artifactId>
<version>1.2.0</version>
</dependency>
```
### Publish events
The following code authenticates with Azure and publishes a `List` of `EventGridEvent` events of a custom type (in this example, `Contoso.Items.ItemsReceived` ) to a topic. The topic key and endpoint address used in the sample can be retrieved from the Azure CLI:
```azurecli-interactive
az eventgrid topic show -g gridResourceGroup -n topicName
az eventgrid topic key list -g gridResourceGroup -n topicName
```
```java
// Create an event grid client.
TopicCredentials topicCredentials = new TopicCredentials(System.getenv("EVENTGRID_TOPIC_KEY"));
EventGridClient client = new EventGridClientImpl(topicCredentials);
// Publish custom events to the EventGrid.
System.out.println("Publish custom events to the EventGrid");
List<EventGridEvent> eventsList = new ArrayList<>();
for (int i = 0; i < 5; i++) {
eventsList.add(new EventGridEvent(
UUID.randomUUID().toString(),
String.format("Door%d", i),
new ContosoItemReceivedEventData("Contoso Item SKU #1"),
"Contoso.Items.ItemReceived",
DateTime.now(),
"2.0"
));
}
String eventGridEndpoint = String.format("https://%s/", new URI(System.getenv("EVENTGRID_TOPIC_ENDPOINT")).getHost());
client.publishEvents(eventGridEndpoint, eventsList);
```
> [!div class="nextstepaction"]
> [Explore the Event Grid Client APIs](/java/api/overview/azure/eventgrid/client)
## Management SDK
Create, update, or delete Event Grid instances, topics, and subscriptions with the Event Grid management SDK.
[Add a dependency](https://maven.apache.org/guides/getting-started/index.html#How_do_I_use_external_dependencies) to your Maven `pom.xml` file to use the client library in your project.
```XML
<dependency>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure</artifactId>
<version>1.16.0</version>
</dependency>
```
The following example creates an Event Grid subscription, taken from the [EventGrid Java samples](https://github.com/Azure-Samples/event-grid-java-publish-consume-events)
```java
// Create an event grid subscription.
//
System.out.println("Creating an Azure EventGrid Subscription");
EventSubscription eventSubscription = eventGridManager.eventSubscriptions().define(eventSubscriptionName)
.withScope(eventGridTopic.id())
.withDestination(new EventHubEventSubscriptionDestination()
.withResourceId(eventHub.id()))
.withFilter(new EventSubscriptionFilter()
.withIsSubjectCaseSensitive(false)
.withSubjectBeginsWith("")
.withSubjectEndsWith(""))
.create();
```
> [!div class="nextstepaction"]
> [Explore the management APIs](/java/api/overview/azure/eventgrid/management)

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

@ -1,69 +0,0 @@
---
title: Azure Event Hub libraries for Java
description: Reference documentation for the Java Event Hub libraries
keywords: Azure, Java, SDK, API, event hub, IoT, stream processing
author: ramya-rao-a
ms.author: ramyar
manager: douge
ms.date: 06/21/2017
ms.topic: reference
ms.prod: azure
ms.technology: azure
ms.devlang: java
ms.service: event-hub
---
# Azure Event Hub libraries for Java
## Overview
Collect and manage millions of events per second from connected IoT devices and applications with [Azure Event Hubs](/azure/event-hubs/event-hubs-what-is-event-hubs).
To get started with Azure Event Hubs, see [Receive events from Azure Event Hubs using Java](/azure/event-hubs/event-hubs-java-get-started-receive-eph).
## Client library
Send events to an Azure Event Hub and consume and process events from an Event Hub using the Event Hubs client library.
[Add a dependency](https://maven.apache.org/guides/getting-started/index.html#How_do_I_use_external_dependencies) to your Maven `pom.xml` file to use the [client library](https://mvnrepository.com/artifact/com.microsoft.azure/azure-eventhubs) in your project.
## Example
Send an event to an event hub.
```java
final ConnectionStringBuilder connStr = new ConnectionStringBuilder()
.setNamespaceName(namespaceName)
.setEventHubName(eventHubName)
.setSasKeyName(sasKeyName)
.setSasKey(sasKey);
final EventHubClient ehClient = EventHubClient.createSync(connStr.toString());
final byte[] payloadBytes = "Test AMQP message".getBytes("UTF-8");
final EventData sendEvent = new EventData(payloadBytes);
ehClient.sendSync(sendEvent);
```
> [!div class="nextstepaction"]
> [Explore the Client APIs](/java/api/overview/azure/eventhubs/client)
## Samples
[Explore Event Hub data-plane API using samples][1]
[Write to Event Hub via JMS and read from Apache Storm][2]
[Read and write from EventHubs using a hybrid .NET/Java topology][3]
[1]: https://github.com/Azure/azure-event-hubs/tree/master/samples/Java
[2]: https://github.com/Azure-Samples/event-hubs-java-storm-sender-jms-receiver
[3]: https://github.com/Azure-Samples/hdinsight-dotnet-java-storm-eventhub
Explore more [sample Java code for Azure Event Hubs](https://azure.microsoft.com/resources/samples/?platform=java&term=event) you can use in your apps.

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

@ -0,0 +1,56 @@
---
title: Azure Key Vault client libraries for Java
description: Overview of the Azure Key Vault libraries for Java
keywords: Azure, Java, SDK, API, keyvault, secure, keys, secrets, vault
author: ramya-rao-a
ms.author: ramyar
manager: douge
ms.date: 11/21/2019
ms.topic: reference
ms.devlang: java
ms.service: key-vault
---
# Azure Key Vault libraries for Java
The Azure Key Vault client libraries for Java offer a convenient interface for making calls to Azure Key Vault. For more information about Azure Key Vault, see [Introduction to Azure Key Vault](https://docs.microsoft.com/azure/key-vault/general/overview).
## Libraries for data access
The latest version of the Azure Key Vault libraries is version 4.x.x. Microsoft recommends using version 4.x.x for new applications.
If you cannot update existing applications to version 4.x.x, then Microsoft recommends using version 1.x.x.
### Version 4.x.x
The version 4.x.x client libraries for Java are part of the Azure SDK for Java. The source code for the Azure Key Vault client libraries for Java is available on [GitHub](https://github.com/Azure/azure-sdk-for-java/tree/master/sdk/keyvault).
Use the following version 4.x.x libraries to work with certificates, keys, and secrets:
| Library | Reference | Package | Source |
|----------------------------------------|-------------------------------------------------------------|-----------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------|
| azure-security-keyvault-certificates | [Reference](https://azuresdkdocs.blob.core.windows.net/$web/java/azure-security-keyvault-certificates/4.1.3/index.html) | [Maven](https://search.maven.org/artifact/com.azure/azure-security-keyvault-certificates) | [GitHub](https://github.com/Azure/azure-sdk-for-java/tree/master/sdk/keyvault/azure-security-keyvault-certificates) |
| azure-security-keyvault-keys | [Reference](https://azuresdkdocs.blob.core.windows.net/$web/java/azure-security-keyvault-keys/4.2.3/index.html) | [Maven](https://search.maven.org/artifact/com.azure/azure-security-keyvault-keys) | [GitHub](https://github.com/Azure/azure-sdk-for-java/tree/master/sdk/keyvault/azure-security-keyvault-keys) |
| azure-security-keyvault-secrets | [Reference](https://azuresdkdocs.blob.core.windows.net/$web/java/azure-security-keyvault-secrets/4.2.3/index.html) | [Maven](https://search.maven.org/artifact/com.azure/azure-security-keyvault-secrets) | [GitHub](https://github.com/Azure/azure-sdk-for-java/tree/master/sdk/keyvault/azure-security-keyvault-secrets) |
### Version 1.x.x
The source code for the Azure Key Vault client libraries for Java is available on [GitHub](https://github.com/Azure/azure-sdk-for-java/tree/master/sdk/keyvault).
Use the following version 1.x.x libraries to work with certificates, keys, and secrets:
| Library | Reference | Package | Source |
|--------------------------------------|---------------------------------------------------------------|-------------------------------------------------------------------------------|-------------------------------------------------------------------------------|
| microsoft-azure-keyvault-core | [Reference](https://docs.microsoft.com/java/api/com.microsoft.azure.keyvault.core?view=azure-java-legacy&viewFallbackFrom=azure-java-stable) | [Maven](https://mvnrepository.com/artifact/com.microsoft.azure/azure-keyvault-core) | [GitHub](https://github.com/Azure/azure-sdk-for-java/tree/master/sdk/keyvault/microsoft-azure-keyvault-core) |
| microsoft-azure-keyvault-cryptography | [Reference](https://docs.microsoft.com/java/api/com.microsoft.azure.keyvault.cryptography?view=azure-java-legacy&viewFallbackFrom=azure-java-stable) | [Maven](https://mvnrepository.com/artifact/com.microsoft.azure/azure-keyvault-cryptography) | [GitHub](https://github.com/Azure/azure-sdk-for-java/tree/master/sdk/keyvault/microsoft-azure-keyvault-cryptography) |
| microsoft-azure-keyvault-extensions | [Reference](https://docs.microsoft.com/java/api/com.microsoft.azure.keyvault.extensions?view=azure-java-legacy&viewFallbackFrom=azure-java-stable) | [Maven](https://mvnrepository.com/artifact/com.microsoft.azure/azure-keyvault-extensions) | [GitHub](https://github.com/Azure/azure-sdk-for-java/tree/master/sdk/keyvault/microsoft-azure-keyvault-extensions) |
| microsoft-azure-keyvault-webkey | [Reference](https://docs.microsoft.com/java/api/com.microsoft.azure.keyvault.webkey?view=azure-java-legacy&viewFallbackFrom=azure-java-stable) | [Maven](https://mvnrepository.com/artifact/com.microsoft.azure/azure-keyvault-webkey) | [GitHub](https://github.com/Azure/azure-sdk-for-java/tree/master/sdk/keyvault/microsoft-azure-keyvault-webkey) |
| microsoft-azure-keyvault | [Reference](https://docs.microsoft.com/java/api/com.microsoft.azure.keyvault?view=azure-java-legacy&viewFallbackFrom=azure-java-stable) | [Maven](https://mvnrepository.com/artifact/com.microsoft.azure/azure-keyvault) | [GitHub](https://github.com/Azure/azure-sdk-for-java/tree/master/sdk/keyvault/microsoft-azure-keyvault) |
## Libraries for resource management
Use the following library to work with the Azure Key Vault resource provider:
| Library | Reference | Package | Source |
|------------------------------------------|-------------------------------------------------------------------|-----------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------|
| azure-mgmt-keyvault | [Reference](https://docs.microsoft.com/java/api/com.microsoft.azure.management.keyvault?view=azure-java-stable) | [Maven](https://mvnrepository.com/artifact/com.microsoft.azure/azure-mgmt-keyvault) | [GitHub](https://github.com/Azure/azure-sdk-for-java/tree/master/sdk/keyvault/mgmt) |

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

@ -1,78 +0,0 @@
---
title: Redis Cache libraries for Java
description: Reference documentation for the Java client and management libraries for Redis Cache
keywords: Azure, Java, SDK, API, cache, redis, web cache, key-value, in-memory
author: ramya-rao-a
ms.author: ramyar
manager: douge
ms.date: 07/11/2017
ms.topic: reference
ms.devlang: java
ms.service: cache
---
# Redis Cache libraries for Java
## Overview
Azure Redis Cache is a secure, distributed key-value store based on the popular open source [Redis](https://redis.io/) cache.
To get started with Azure Redis Cache, see [How to use Azure Redis Cache with Java](/azure/redis-cache/cache-java-get-started).
## Client library
Connect to Azure Redis Cache and store and retrieve values from the cache using the open-source [Jedis](https://github.com/xetorthio/jedis) client.
[Add a dependency](https://maven.apache.org/guides/getting-started/index.html#How_do_I_use_external_dependencies) to your Maven `pom.xml` file to use the client library in your project.
```XML
<dependency>
<groupId>redis.clients</groupId>
<artifactId>jedis</artifactId>
<version>2.9.0</version>
<type>jar</type>
</dependency>
```
## Example
Connect to Azure Redis and insert a string into the cache.
```java
JedisShardInfo shardInfo = new JedisShardInfo("<name>.redis.cache.windows.net", 6380, useSsl);
shardInfo.setPassword("<key>"); /* Use your access key. */
Jedis jedis = new Jedis(shardInfo);
jedis.set("foo", "bar");
```
## Management API
Create and scale Azure Redis resources and manage access keys to with the management API.
```XML
<dependency>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure-mgmt-redis</artifactId>
<version>1.3.0</version>
</dependency>
```
## Example
Create a new Azure Redis Cache in the [two-node standard tier](https://azure.microsoft.com/services/cache/).
```java
RedisCache cache = azure.redisCaches().define(redisCacheName1)
.withRegion(Region.US_CENTRAL)
.withNewResourceGroup(rgName)
.withStandardSku();
```
> [!div class="nextstepaction"]
> [Explore the Management APIs](/java/api/overview/azure/rediscache/management)
## Samples
[Manage Azure Redis Cache](https://github.com/Azure-Samples/redis-java-manage-cache)
Explore more [sample Java code for Azure Redis Cache](https://azure.microsoft.com/resources/samples/?platform=java&term=redis) you can use in your apps.

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

@ -1,147 +0,0 @@
---
title: Service Bus libraries for Java
description: Reference documentation for the Java client and management libraries for Service Bus
keywords: Azure, Java, SDK, API, messaging, amqp, qpid, JMS, pubsub, pub-sub, message broker
author: ramya-rao-a
ms.author: ramyar
manager: douge
ms.date: 07/11/2017
ms.topic: reference
ms.prod: azure
ms.technology: azure
ms.devlang: java
ms.service: service-bus
---
# Service Bus libraries for Java
## Overview
Service Bus is an enterprise-class, transactional messaging platform service that provides highly reliable queues
and publish/subscribe topics with deep feature capabilities such as ordered delivery, sessions, partitioning,
scheduling, complex subscriptions, as well as workflow and transaction handling.
The Service Bus feature capabilities are comparable and often exceed those of high-end, on-premises legacy message
brokers. The Service Bus features are available via standards-based protocols like AMQP 1.0 and HTTPS and all
protocol gestures are fully documented, allowing for broad interoperability.
Focusing on highly available and reliable durable messaging, the Service Bus Premium provides competitive throughput
performance even with substantial local datacenter deployments, but without hardware selection and acquisition
processes, deployment planning and execution, and endless performance optimization sessions.
Service Bus Premium is a fully managed offering with dedicated capacity reserved for each tenant that yields
predictable performance with a simple, capacity-oriented pricing model and at extremely lower overall cost than
commercial on-premises brokers. For many customers, Service Bus Premium can replace dedicated on-premises messaging
clusters today, even if the attached workloads do not run in the cloud.
Learn more about Service Bus concepts [in the messaging documentation section](https://docs.microsoft.com/azure/service-bus-messaging/)
For Java developers, Service Bus provides a Microsoft supported native API and Service Bus can also be used with
AMQP 1.0 compliant libraries such as Apache Qpid Proton's JMS provider.
## Client library
The official Service Bus client is available in [source code form on GitHub](https://github.com/Azure/azure-sdk-for-java/tree/master/sdk/servicebus/) and
binaries and packaged sources [are available on Maven Central](http://search.maven.org/#search%7Cga%7C1%7Ca%3A%22azure-servicebus%22).
**The [sample code repository](https://github.com/Azure/azure-service-bus/blob/master/samples/Java/) contains samples for:**
* How to use the [QueueClient](https://github.com/Azure/azure-service-bus/blob/master/samples/Java/azure-servicebus/QueuesGettingStarted/src/main/java/com/microsoft/azure/servicebus/samples/queuesgettingstarted/QueuesGettingStarted.java)
* How to use the [TopicClient and SubscriptionClient](https://github.com/Azure/azure-service-bus/tree/master/samples/Java/azure-servicebus/TopicsGettingStarted/src/main/java/com/microsoft/azure/servicebus/samples/topicsgettingstarted)
[Add a dependency](https://maven.apache.org/guides/getting-started/index.html#How_do_I_use_external_dependencies) to your Maven `pom.xml` file to use the client library in your project. Specify the version as desired.
```XML
<dependency>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure-servicebus</artifactId>
<version>1.0.0</version>
</dependency>
```
```java
public class BasicSendReceiveWithQueueClient {
// Connection String for the namespace can be obtained from the Azure portal under the
// 'Shared Access policies' section.
private static final String connectionString = "{connection string}";
private static final String queueName = "{queue name}";
private static IQueueClient queueClient;
private static int totalSend = 100;
private static int totalReceived = 0;
public static void main(String[] args) throws Exception {
Log.log("Starting BasicSendReceiveWithQueueClient sample");
// create client
Log.log("Create queue client.");
queueClient = new QueueClient(new ConnectionStringBuilder(connectionString, queueName), ReceiveMode.PeekLock);
// send and receive
queueClient.registerMessageHandler(new MessageHandler(queueClient), new MessageHandlerOptions(1, false, Duration.ofMinutes(1)));
for (int i = 0; i < totalSend; i++) {
int j = i;
Log.log("Sending message #%d.", j);
queueClient.sendAsync(new Message("" + i)).thenRunAsync(() -> { Log.log("Sent message #%d.", j);});
}
while(totalReceived != totalSend) {
Thread.sleep(1000);
}
Log.log("Received all messages, exiting the sample.");
Log.log("Closing queue client.");
queueClient.close();
}
static class MessageHandler implements IMessageHandler {
private IQueueClient client;
public MessageHandler(IQueueClient client) {
this.client = client;
}
@Override
public CompletableFuture<Void> onMessageAsync(IMessage iMessage) {
Log.log("Received message with sq#: %d and lock token: %s.", iMessage.getSequenceNumber(), iMessage.getLockToken());
return this.client.completeAsync(iMessage.getLockToken()).thenRunAsync(() -> {
Log.log("Completed message sq#: %d and locktoken: %s", iMessage.getSequenceNumber(), iMessage.getLockToken());
totalReceived++;
});
}
@Override
public void notifyException(Throwable throwable, ExceptionPhase exceptionPhase) {
Log.log(exceptionPhase + "-" + throwable.getMessage());
}
}
}
```
> [!div class="nextstepaction"]
> [Explore the Client APIs](/java/api/overview/azure/servicebus/client)
> [Find more examples here (See also above for more details)](https://github.com/Azure/azure-service-bus/blob/master/samples/Java/)
## Management API
Create and manage namespaces, topics, queues, and subscriptions with the management API.
**Please find some examples here:**
* [Manage Service Bus queues](https://github.com/Azure-Samples/service-bus-java-manage-queue-with-basic-features)
* [Create and subscribe to Service Bus topics](https://github.com/Azure-Samples/service-bus-java-manage-publish-subscribe-with-basic-features)
**Use the Management API in your project:**
\
[Add a dependency](https://maven.apache.org/guides/getting-started/index.html#How_do_I_use_external_dependencies) to your Maven `pom.xml` file to use the management API in your project.
```XML
<dependency>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure-mgmt-servicebus</artifactId>
<version>1.3.0</version>
</dependency>
```
> [!div class="nextstepaction"]
> [Explore the Management APIs](/java/api/overview/azure/servicebus/management)
Explore more [sample Java code for Azure Service Bus](https://azure.microsoft.com/resources/samples/?platform=java&term=bus) you can use in your apps.

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

@ -1,61 +0,0 @@
---
title: Azure Traffic Manager libraries for Java
description: Reference documentation for the Java Traffic Manager management libraries
keywords: Azure, Java, SDK, API, load balancing, load distribution, network, Traffic Manager
author: ramya-rao-a
ms.author: ramyar
manager: douge
ms.date: 07/11/2017
ms.topic: reference
ms.prod: azure
ms.technology: azure
ms.devlang: java
ms.service: traffic-manager
---
# Azure Traffic Manager libraries for Java
## Overview
Control the distribution of user traffic for service endpoints in different datacenters with [Azure Traffic Manager](/azure/traffic-manager/traffic-manager-overview).
To get started with Azure Traffic Manager, see [Create a Traffic Manager profile](/azure/traffic-manager/traffic-manager-create-profile).
## Management API
Create Traffic Manager profiles, define endpoints, and change the routing method with the management API.
[Add a dependency](https://maven.apache.org/guides/getting-started/index.html#How_do_I_use_external_dependencies) to your Maven `pom.xml` file to use the management API in your project.
```XML
<dependency>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure-mgmt-trafficmanager</artifactId>
<version>1.3.0</version>
</dependency>
```
## Example
Create a Traffic Manager profile and assign a single endpoint.
```java
TrafficManagerProfile tmProfile = azure.trafficManagerProfiles().define("testTMProfile")
.withNewResourceGroup(Region.US_EAST)
.withLeafDomainLabel("testTMProfile")
.withPriorityBasedRouting()
.defineAzureTargetEndpoint("endpoint")
.toResourceId(webAppId)
.withRoutingPriority(1)
.attach()
.create();
```
> [!div class="nextstepaction"]
> [Explore the Management APIs](/java/api/overview/azure/trafficmanager/management)
## Samples
[Balance web app traffic across multiple regions](https://github.com/Azure-Samples/traffic-manager-java-manage-profiles)
Explore more [sample Java code for Azure Traffic Manager](https://azure.microsoft.com/resources/samples/?platform=java&term=traffic) you can use in your apps.