Skip to content

Commit 28b4950

Browse files
authored
Merge pull request #113730 from anfeldma-ms/TSTipsForTeamApproval
Java SDK v4 troubleshooting & unambiguous versioning in titles/TOC
2 parents e84c486 + 1d72947 commit 28b4950

File tree

4 files changed

+300
-15
lines changed

4 files changed

+300
-15
lines changed

articles/cosmos-db/TOC.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -984,8 +984,12 @@
984984
items:
985985
- name: Troubleshoot query performance
986986
href: troubleshoot-query-performance.md
987-
- name: Troubleshoot Java Async SDK
988-
href: troubleshoot-java-async-sdk.md
987+
- name: Troubleshoot Java SDK v4
988+
href: troubleshoot-java-sdk-v4-sql.md
989+
- name: Troubleshoot older Java SDKs
990+
items:
991+
- name: Async Java SDK v2
992+
href: troubleshoot-java-async-sdk.md
989993
- name: Troubleshoot .NET SDK
990994
href: troubleshoot-dot-net-sdk.md
991995
- name: Change Feed

articles/cosmos-db/troubleshoot-dot-net-sdk.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,22 @@
11
---
22
title: Diagnose and troubleshoot issues when using Azure Cosmos DB .NET SDK
33
description: Use features like client-side logging and other third-party tools to identify, diagnose, and troubleshoot Azure Cosmos DB issues when using .NET SDK.
4-
author: j82w
4+
author: anfeldma-ms
55
ms.service: cosmos-db
6-
ms.date: 03/11/2020
7-
ms.author: jawilley
6+
ms.date: 05/06/2020
7+
ms.author: anfeldma
88
ms.subservice: cosmosdb-sql
99
ms.topic: troubleshooting
1010
ms.reviewer: sngun
1111
---
1212
# Diagnose and troubleshoot issues when using Azure Cosmos DB .NET SDK
13+
14+
> [!div class="op_single_selector"]
15+
> * [Java SDK v4](troubleshoot-java-sdk-v4-sql.md)
16+
> * [Async Java SDK v2](troubleshoot-java-async-sdk.md)
17+
> * [.NET](troubleshoot-dot-net-sdk.md)
18+
>
19+
1320
This article covers common issues, workarounds, diagnostic steps, and tools when you use the [.NET SDK](sql-api-sdk-dotnet.md) with Azure Cosmos DB SQL API accounts.
1421
The .NET SDK provides client-side logical representation to access the Azure Cosmos DB SQL API. This article describes tools and approaches to help you if you run into any issues.
1522

articles/cosmos-db/troubleshoot-java-async-sdk.md

Lines changed: 32 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,30 @@
11
---
2-
title: Diagnose and troubleshoot Azure Cosmos DB Java Async SDK
3-
description: Use features like client-side logging and other third-party tools to identify, diagnose, and troubleshoot Azure Cosmos DB issues.
4-
author: moderakh
2+
title: Diagnose and troubleshoot Azure Cosmos DB Async Java SDK v2
3+
description: Use features like client-side logging and other third-party tools to identify, diagnose, and troubleshoot Azure Cosmos DB issues in Async Java SDK v2.
4+
author: anfeldma-ms
55
ms.service: cosmos-db
6-
ms.date: 04/30/2019
7-
ms.author: moderakh
6+
ms.date: 05/04/2020
7+
ms.author: anfeldma
88
ms.devlang: java
99
ms.subservice: cosmosdb-sql
1010
ms.topic: troubleshooting
1111
ms.reviewer: sngun
1212
---
1313

1414
# Troubleshoot issues when you use the Java Async SDK with Azure Cosmos DB SQL API accounts
15+
16+
> [!div class="op_single_selector"]
17+
> * [Java SDK v4](troubleshoot-java-sdk-v4-sql.md)
18+
> * [Async Java SDK v2](troubleshoot-java-async-sdk.md)
19+
> * [.NET](troubleshoot-dot-net-sdk.md)
20+
>
21+
22+
> [!IMPORTANT]
23+
> This is *not* the latest Java SDK for Azure Cosmos DB! Consider using Azure Cosmos DB Java SDK v4 for your project. Follow the instructions in the [Migrate to Azure Cosmos DB Java SDK v4](https://github.com/Azure-Samples/azure-cosmos-java-sql-api-samples/blob/master/migration-guide.md) guide and [Reactor vs RxJava](https://github.com/Azure-Samples/azure-cosmos-java-sql-api-samples/blob/master/reactor-rxjava-guide.md) guide to upgrade.
24+
>
25+
> This article covers troubleshooting for Azure Cosmos DB Async Java SDK v2 only. See the Azure Cosmos DB Async Java SDK v2 [Release Notes](sql-api-sdk-async-java.md), [Maven repository](https://mvnrepository.com/artifact/com.microsoft.azure/azure-cosmosdb) and [performance tips](performance-tips-async-java.md) for more information.
26+
>
27+
1528
This article covers common issues, workarounds, diagnostic steps, and tools when you use the [Java Async SDK](sql-api-sdk-async-java.md) with Azure Cosmos DB SQL API accounts.
1629
The Java Async SDK provides client-side logical representation to access the Azure Cosmos DB SQL API. This article describes tools and approaches to help you if you run into any issues.
1730

@@ -75,6 +88,9 @@ The SDK uses the [Netty](https://netty.io/) IO library to communicate with Azure
7588
The Netty IO threads are meant to be used only for non-blocking Netty IO work. The SDK returns the API invocation result on one of the Netty IO threads to the app's code. If the app performs a long-lasting operation after it receives results on the Netty thread, the SDK might not have enough IO threads to perform its internal IO work. Such app coding might result in low throughput, high latency, and `io.netty.handler.timeout.ReadTimeoutException` failures. The workaround is to switch the thread when you know the operation takes time.
7689

7790
For example, take a look at the following code snippet. You might perform long-lasting work that takes more than a few milliseconds on the Netty thread. If so, you eventually can get into a state where no Netty IO thread is present to process IO work. As a result, you get a ReadTimeoutException failure.
91+
92+
### <a id="asyncjava2-readtimeout"></a>Async Java SDK V2 (Maven com.microsoft.azure::azure-cosmosdb)
93+
7894
```java
7995
@Test
8096
public void badCodeWithReadTimeoutException() throws Exception {
@@ -126,13 +142,19 @@ public void badCodeWithReadTimeoutException() throws Exception {
126142
assertThat(failureCount.get()).isGreaterThan(0);
127143
}
128144
```
129-
The workaround is to change the thread on which you perform work that takes time. Define a singleton instance of the scheduler for your app.
130-
```java
145+
The workaround is to change the thread on which you perform work that takes time. Define a singleton instance of the scheduler for your app.
146+
147+
### <a id="asyncjava2-scheduler"></a>Async Java SDK V2 (Maven com.microsoft.azure::azure-cosmosdb)
148+
149+
```java
131150
// Have a singleton instance of an executor and a scheduler.
132151
ExecutorService ex = Executors.newFixedThreadPool(30);
133152
Scheduler customScheduler = rx.schedulers.Schedulers.from(ex);
134-
```
135-
You might need to do work that takes time, for example, computationally heavy work or blocking IO. In this case, switch the thread to a worker provided by your `customScheduler` by using the `.observeOn(customScheduler)` API.
153+
```
154+
You might need to do work that takes time, for example, computationally heavy work or blocking IO. In this case, switch the thread to a worker provided by your `customScheduler` by using the `.observeOn(customScheduler)` API.
155+
156+
### <a id="asyncjava2-applycustomscheduler"></a>Async Java SDK V2 (Maven com.microsoft.azure::azure-cosmosdb)
157+
136158
```java
137159
Observable<ResourceResponse<Document>> createObservable = client
138160
.createDocument(getCollectionLink(), docDefinition, null, false);
@@ -165,7 +187,7 @@ Exception in thread "main" java.lang.NoSuchMethodError: rx.Observable.toSingle()
165187

166188
The above exception suggests you have a dependency on an older version of RxJava lib (e.g., 1.2.2). Our SDK relies on RxJava 1.3.8 which has APIs not available in earlier version of RxJava.
167189

168-
The workaround for such issuses is to identify which other dependency brings in RxJava-1.2.2 and exclude the transitive dependency on RxJava-1.2.2, and allow CosmosDB SDK bring the newer version.
190+
The workaround for such issues is to identify which other dependency brings in RxJava-1.2.2 and exclude the transitive dependency on RxJava-1.2.2, and allow CosmosDB SDK bring the newer version.
169191

170192
To identify which library brings in RxJava-1.2.2 run the following command next to your project pom.xml file:
171193
```bash

0 commit comments

Comments
 (0)