Skip to content

Commit ad78ffb

Browse files
committed
Updating web app doc & removing the Java Console tutorial docs
1 parent 9c469c9 commit ad78ffb

File tree

5 files changed

+32
-485
lines changed

5 files changed

+32
-485
lines changed

.openpublishing.redirection.json

Lines changed: 11 additions & 1 deletion
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",
@@ -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: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,6 @@
3939
href: sql-api-java-get-started.md
4040
- name: Async Java
4141
href: sql-api-async-java-get-started.md
42-
- name: Async Java sample with change feed
43-
href: create-sql-api-java-changefeed.md
4442
- name: Node.js
4543
href: sql-api-nodejs-get-started.md
4644
- name: Build a web app
@@ -1012,6 +1010,8 @@
10121010
href: how-to-use-change-feed-estimator.md
10131011
- name: Migrate from change feed processor library
10141012
href: how-to-migrate-from-change-feed-library.md
1013+
- name: Change feed - Async Java sample
1014+
href: create-sql-api-java-changefeed.md
10151015
- name: Built-in analytics with Apache Spark
10161016
items:
10171017
- name: Azure Databricks Spark connector

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

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
---
2-
title: Tutorial - an end-to-end Async Java SQL API application sample with Change Feed
3-
description: This tutorial 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.
2+
title: Use change feed with an Async Java SQL API application in Azure Cosmos DB
3+
description: Learn how to use develop a Async Java SQL API application which inserts documents into an Azure Cosmos DB container, while maintaining a materialized view of the container using change feed.
44
author: anfeldma
55
ms.service: cosmos-db
66
ms.subservice: cosmosdb-sql
77
ms.devlang: java
8-
ms.topic: tutorial
9-
ms.date: 04/01/2020
8+
ms.topic: conceptual
9+
ms.date: 05/07/2020
1010
ms.author: anfeldma
1111
---
1212

13-
# Tutorial - an end-to-end Async Java SQL API application sample with Change Feed
13+
# How to use change feed with an Async Java SQL API application in Azure Cosmos DB
1414

15-
This tutorial 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.
15+
This tutorial 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.
1616

1717
## Prerequisites
1818

@@ -26,11 +26,11 @@ This tutorial guide walks you through a simple Java SQL API application which in
2626

2727
## Background
2828

29-
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.
29+
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.
3030

31-
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.
31+
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.
3232

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

3535
## Setup
3636

@@ -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
# [Java SDK 4.0](#tab/v4sdk)
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
# [Java SDK 3.7.0](#tab/v3sdk)
@@ -109,17 +109,17 @@ mvn clean package
109109
})
110110
.subscribe();
111111
112-
while (!isProcessorRunning.get()); //Wait for Change Feed processor start
112+
while (!isProcessorRunning.get()); //Wait for change feed processor start
113113
```
114114
---
115115
116-
```"SampleHost_1"``` is the name of the Change Feed processor worker. ```changeFeedProcessorInstance.start()``` is what actually starts the Change Feed processor.
116+
```"SampleHost_1"``` is the name of the change feed processor worker. ```changeFeedProcessorInstance.start()``` is what actually starts the change feed processor.
117117
118-
Return to the Azure Portal Data Explorer in your browser. Under the **InventoryContainer-leases** container, click **items** to see its contents. You will see that Change Feed Processor has populated the lease container, i.e. the processor has assigned the ```SampleHost_1``` worker a lease on some partitions of the **InventoryContainer**.
118+
Return to the Azure Portal Data Explorer in your browser. Under the **InventoryContainer-leases** container, click **items** to see its contents. You will see that change feed Processor has populated the lease container, i.e. the processor has assigned the ```SampleHost_1``` worker a lease on some partitions of the **InventoryContainer**.
119119
120120
![Leases](media/create-sql-api-java-changefeed/cosmos_leases.JPG)
121121
122-
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:
122+
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:
123123
124124
# [Java SDK 4.0](#tab/v4sdk)
125125
@@ -180,7 +180,7 @@ mvn clean package
180180
181181
![Feed container](media/create-sql-api-java-changefeed/cosmos_items.JPG)
182182
183-
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```.
183+
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```.
184184
185185
![Materialized view](media/create-sql-api-java-changefeed/cosmos_materializedview2.JPG)
186186
@@ -248,10 +248,10 @@ mvn clean package
248248
```
249249
---
250250
251-
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**.
251+
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**.
252252
253253
The effect is that after about 5 seconds, the document will expire and be deleted from both containers.
254254
255-
This procedure is necessary because Change Feed only issues events on item insertion or update, not on item deletion.
255+
This procedure is necessary because change feed only issues events on item insertion or update, not on item deletion.
256256
257257
1. Press enter one more time to close the program and clean up its resources.

0 commit comments

Comments
 (0)