Skip to content

Commit e00e111

Browse files
Merge pull request #114416 from SnehaGunda/JavaWebapp
Updating web app doc & removing the Java Console tutorial docs
2 parents d60566b + d97a56e commit e00e111

7 files changed

+34
-487
lines changed

.openpublishing.redirection.json

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2436,6 +2436,16 @@
24362436
"redirect_url": "/azure/cosmos-db/how-to-multi-master",
24372437
"redirect_document_id": true
24382438
},
2439+
{
2440+
"source_path": "articles/cosmos-db/sql-api-java-get-started.md",
2441+
"redirect_url": "/azure/cosmos-db/create-sql-api-java",
2442+
"redirect_document_id": false
2443+
},
2444+
{
2445+
"source_path": "articles/cosmos-db/sql-api-async-java-get-started.md",
2446+
"redirect_url": "/azure/cosmos-db/create-sql-api-java",
2447+
"redirect_document_id": false
2448+
},
24392449
{
24402450
"source_path": "articles/cosmos-db/create-sql-api-dotnet-preview.md",
24412451
"redirect_url": "/azure/cosmos-db/create-sql-api-dotnet",
@@ -15088,7 +15098,7 @@
1508815098
{
1508915099
"source_path": "articles/cosmos-db/create-documentdb-java.md",
1509015100
"redirect_url": "/azure/cosmos-db/create-sql-api-java",
15091-
"redirect_document_id": true
15101+
"redirect_document_id": false
1509215102
},
1509315103
{
1509415104
"source_path": "articles/cosmos-db/create-documentdb-nodejs.md",
@@ -15167,7 +15177,7 @@
1516715177
},
1516815178
{
1516915179
"source_path": "articles/cosmos-db/documentdb-java-get-started.md",
15170-
"redirect_url": "/azure/cosmos-db/sql-api-java-get-started",
15180+
"redirect_url": "/azure/cosmos-db/create-sql-api-java",
1517115181
"redirect_document_id": true
1517215182
},
1517315183
{

articles/cosmos-db/TOC.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1018,7 +1018,7 @@
10181018
href: how-to-use-change-feed-estimator.md
10191019
- name: Migrate from change feed processor library
10201020
href: how-to-migrate-from-change-feed-library.md
1021-
- name: Create a Java SQL application with Change Feed
1021+
- name: Change feed - Async Java sample
10221022
href: create-sql-api-java-changefeed.md
10231023
- name: Built-in analytics with Apache Spark
10241024
items:

articles/cosmos-db/create-sql-api-java-changefeed.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Create an end-to-end Azure Cosmos DB Java SDK v4 application sample by using Change Feed
3-
description: This how-to guide walks you through a simple Java SQL API application which inserts documents into an Azure Cosmos DB container, while maintaining a materialized view of the container using Change Feed.
4-
author: anfeldma
3+
description: This guide walks you through a simple Java SQL API application which inserts documents into an Azure Cosmos DB container, while maintaining a materialized view of the container using Change Feed.
4+
author: anfeldma-ms
55
ms.service: cosmos-db
66
ms.subservice: cosmosdb-sql
77
ms.devlang: java
@@ -10,7 +10,7 @@ ms.date: 05/08/2020
1010
ms.author: anfeldma
1111
---
1212

13-
# How to create a Java application that uses Azure Cosmos DB SQL API and Change Feed Processor
13+
# How to create a Java application that uses Azure Cosmos DB SQL API and change feed processor
1414

1515
> [!IMPORTANT]
1616
> For more information on Azure Cosmos DB Java SDK v4, please view the Azure Cosmos DB Java SDK v4 Release notes, [Maven repository](https://mvnrepository.com/artifact/com.azure/azure-cosmos), Azure Cosmos DB Java SDK v4 [performance tips](performance-tips-java-sdk-v4-sql.md), and Azure Cosmos DB Java SDK v4 [troubleshooting guide](troubleshoot-java-sdk-v4-sql.md).
@@ -28,11 +28,11 @@ This how-to guide walks you through a simple Java application which uses the Azu
2828

2929
## Background
3030

31-
The Azure Cosmos DB Change Feed provides an event-driven interface to trigger actions in response to document insertion. This has many uses. For example in applications which are both read and write heavy, a chief use of Change Feed is to create a real-time **materialized view** of a container as it is ingesting documents. The materialized view container will hold the same data but partitioned for efficient reads, making the application both read and write efficient.
31+
The Azure Cosmos DB change feed provides an event-driven interface to trigger actions in response to document insertion. This has many uses. For example in applications which are both read and write heavy, a chief use of change feed is to create a real-time **materialized view** of a container as it is ingesting documents. The materialized view container will hold the same data but partitioned for efficient reads, making the application both read and write efficient.
3232

33-
The work of managing Change Feed events is largely taken care of by the Change Feed Processor library built into the SDK. This library is powerful enough to distribute Change Feed events among multiple workers, if that is desired. All you have to do is provide the Change Feed library a callback.
33+
The work of managing change feed events is largely taken care of by the change feed Processor library built into the SDK. This library is powerful enough to distribute change feed events among multiple workers, if that is desired. All you have to do is provide the change feed library a callback.
3434

35-
This simple example demonstrates Change Feed Processor library with a single worker creating and deleting documents from a materialized view.
35+
This simple example demonstrates change feed Processor library with a single worker creating and deleting documents from a materialized view.
3636

3737
## Setup
3838

@@ -70,7 +70,7 @@ mvn clean package
7070

7171
* **InventoryContainer** - The inventory record for our example grocery store, partitioned on item ```id``` which is a UUID.
7272
* **InventoryContainer-pktype** - A materialized view of the inventory record, optimized for queries over item ```type```
73-
* **InventoryContainer-leases** - A leases container is always needed for Change Feed; leases track the app's progress in reading the Change Feed.
73+
* **InventoryContainer-leases** - A leases container is always needed for change feed; leases track the app's progress in reading the change feed.
7474

7575

7676
![Empty containers](media/create-sql-api-java-changefeed/cosmos_account_resources_lease_empty.JPG)
@@ -82,7 +82,7 @@ mvn clean package
8282
Press enter to start creating the materialized view...
8383
```
8484

85-
Press enter. Now the following block of code will execute and initialize the Change Feed processor on another thread:
85+
Press enter. Now the following block of code will execute and initialize the change feed processor on another thread:
8686

8787
### <a id="java4-connection-policy-async"></a>Java SDK V4 (Maven com.azure::azure-cosmos) Async API
8888

@@ -95,7 +95,7 @@ mvn clean package
9595
})
9696
.subscribe();
9797
98-
while (!isProcessorRunning.get()); //Wait for Change Feed processor start
98+
while (!isProcessorRunning.get()); //Wait for change feed processor start
9999
```
100100
101101
```"SampleHost_1"``` is the name of the Change Feed processor worker. ```changeFeedProcessorInstance.start()``` is what actually starts the Change Feed processor.
@@ -104,7 +104,7 @@ mvn clean package
104104
105105
![Leases](media/create-sql-api-java-changefeed/cosmos_leases.JPG)
106106
107-
1. Press enter again in the terminal. This will trigger 10 documents to be inserted into **InventoryContainer**. Each document insertion appears in the Change Feed as JSON; the following callback code handles these events by mirroring the JSON documents into a materialized view:
107+
1. Press enter again in the terminal. This will trigger 10 documents to be inserted into **InventoryContainer**. Each document insertion appears in the change feed as JSON; the following callback code handles these events by mirroring the JSON documents into a materialized view:
108108
109109
### <a id="java4-connection-policy-async"></a>Java SDK V4 (Maven com.azure::azure-cosmos) Async API
110110
@@ -137,7 +137,7 @@ mvn clean package
137137
138138
![Feed container](media/create-sql-api-java-changefeed/cosmos_items.JPG)
139139
140-
1. Now, in Data Explorer navigate to **InventoryContainer-pktype > items**. This is the materialized view - the items in this container mirror **InventoryContainer** because they were inserted programmatically by Change Feed. Note the partition key (```type```). So this materialized view is optimized for queries filtering over ```type```, which would be inefficient on **InventoryContainer** because it is partitioned on ```id```.
140+
1. Now, in Data Explorer navigate to **InventoryContainer-pktype > items**. This is the materialized view - the items in this container mirror **InventoryContainer** because they were inserted programmatically by change feed. Note the partition key (```type```). So this materialized view is optimized for queries filtering over ```type```, which would be inefficient on **InventoryContainer** because it is partitioned on ```id```.
141141
142142
![Materialized view](media/create-sql-api-java-changefeed/cosmos_materializedview2.JPG)
143143
@@ -176,10 +176,10 @@ mvn clean package
176176
}
177177
```
178178
179-
The Change Feed ```feedPollDelay``` is set to 100ms; therefore, Change Feed responds to this update almost instantly and calls ```updateInventoryTypeMaterializedView()``` shown above. That last function call will upsert the new document with TTL of 5sec into **InventoryContainer-pktype**.
179+
The change feed ```feedPollDelay``` is set to 100ms; therefore, change feed responds to this update almost instantly and calls ```updateInventoryTypeMaterializedView()``` shown above. That last function call will upsert the new document with TTL of 5sec into **InventoryContainer-pktype**.
180180
181181
The effect is that after about 5 seconds, the document will expire and be deleted from both containers.
182182
183-
This procedure is necessary because Change Feed only issues events on item insertion or update, not on item deletion.
183+
This procedure is necessary because change feed only issues events on item insertion or update, not on item deletion.
184184
185185
1. Press enter one more time to close the program and clean up its resources.

articles/cosmos-db/how-to-time-to-live.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Configure and manage Time to Live in Azure Cosmos DB
33
description: Learn how to configure and manage time to live on a container and an item in Azure Cosmos DB
4-
author: markjbrown
4+
author: anfeldma-ms
55
ms.service: cosmos-db
66
ms.topic: conceptual
77
ms.date: 03/27/2020

0 commit comments

Comments
 (0)