mirror of https://github.com/dapr/docs.git
Merge branch 'v1.13' into metrics-cardinality
This commit is contained in:
commit
6d9e277e8a
|
@ -162,7 +162,7 @@ APIs that generate random numbers, random UUIDs, or the current date are _non-de
|
||||||
|
|
||||||
For example, instead of this:
|
For example, instead of this:
|
||||||
|
|
||||||
{{< tabs ".NET" Java >}}
|
{{< tabs ".NET" Java JavaScript >}}
|
||||||
|
|
||||||
{{% codetab %}}
|
{{% codetab %}}
|
||||||
|
|
||||||
|
@ -186,11 +186,22 @@ string randomString = GetRandomString();
|
||||||
|
|
||||||
{{% /codetab %}}
|
{{% /codetab %}}
|
||||||
|
|
||||||
|
{{% codetab %}}
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
// DON'T DO THIS!
|
||||||
|
const currentTime = new Date();
|
||||||
|
const newIdentifier = uuidv4();
|
||||||
|
const randomString = getRandomString();
|
||||||
|
```
|
||||||
|
|
||||||
|
{{% /codetab %}}
|
||||||
|
|
||||||
{{< /tabs >}}
|
{{< /tabs >}}
|
||||||
|
|
||||||
Do this:
|
Do this:
|
||||||
|
|
||||||
{{< tabs ".NET" Java >}}
|
{{< tabs ".NET" Java JavaScript >}}
|
||||||
|
|
||||||
{{% codetab %}}
|
{{% codetab %}}
|
||||||
|
|
||||||
|
@ -214,6 +225,16 @@ String randomString = context.callActivity(GetRandomString.class.getName(), Stri
|
||||||
|
|
||||||
{{% /codetab %}}
|
{{% /codetab %}}
|
||||||
|
|
||||||
|
{{% codetab %}}
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
// Do this!!
|
||||||
|
const currentTime = context.getCurrentUtcDateTime();
|
||||||
|
const randomString = yield context.callActivity(getRandomString);
|
||||||
|
```
|
||||||
|
|
||||||
|
{{% /codetab %}}
|
||||||
|
|
||||||
{{< /tabs >}}
|
{{< /tabs >}}
|
||||||
|
|
||||||
|
|
||||||
|
@ -224,7 +245,7 @@ Instead, workflows should interact with external state _indirectly_ using workfl
|
||||||
|
|
||||||
For example, instead of this:
|
For example, instead of this:
|
||||||
|
|
||||||
{{< tabs ".NET" Java >}}
|
{{< tabs ".NET" Java JavaScript >}}
|
||||||
|
|
||||||
{{% codetab %}}
|
{{% codetab %}}
|
||||||
|
|
||||||
|
@ -247,11 +268,31 @@ HttpResponse<String> response = HttpClient.newBuilder().build().send(request, Ht
|
||||||
|
|
||||||
{{% /codetab %}}
|
{{% /codetab %}}
|
||||||
|
|
||||||
|
{{% codetab %}}
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
// DON'T DO THIS!
|
||||||
|
// Accessing an Environment Variable (Node.js)
|
||||||
|
const configuration = process.env.MY_CONFIGURATION;
|
||||||
|
|
||||||
|
fetch('https://postman-echo.com/get')
|
||||||
|
.then(response => response.text())
|
||||||
|
.then(data => {
|
||||||
|
console.log(data);
|
||||||
|
})
|
||||||
|
.catch(error => {
|
||||||
|
console.error('Error:', error);
|
||||||
|
});
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
{{% /codetab %}}
|
||||||
|
|
||||||
{{< /tabs >}}
|
{{< /tabs >}}
|
||||||
|
|
||||||
Do this:
|
Do this:
|
||||||
|
|
||||||
{{< tabs ".NET" Java >}}
|
{{< tabs ".NET" Java JavaScript >}}
|
||||||
|
|
||||||
{{% codetab %}}
|
{{% codetab %}}
|
||||||
|
|
||||||
|
@ -273,6 +314,16 @@ String data = ctx.callActivity(MakeHttpCall.class, "https://example.com/api/data
|
||||||
|
|
||||||
{{% /codetab %}}
|
{{% /codetab %}}
|
||||||
|
|
||||||
|
{{% codetab %}}
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
// Do this!!
|
||||||
|
const configuation = workflowInput.getConfiguration(); // imaginary workflow input argument
|
||||||
|
const data = yield ctx.callActivity(makeHttpCall, "https://example.com/api/data");
|
||||||
|
```
|
||||||
|
|
||||||
|
{{% /codetab %}}
|
||||||
|
|
||||||
{{< /tabs >}}
|
{{< /tabs >}}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -23,9 +23,9 @@ Dapr initialization includes:
|
||||||
1. Running a **Dapr placement service container instance** for local actor support.
|
1. Running a **Dapr placement service container instance** for local actor support.
|
||||||
|
|
||||||
{{% alert title="Docker" color="primary" %}}
|
{{% alert title="Docker" color="primary" %}}
|
||||||
The recommended development environment requires [Docker](https://docs.docker.com/install/). While you can [initialize Dapr without a dependency on Docker]({{<ref self-hosted-no-docker.md>}})), the next steps in this guide assume the recommended Docker development environment.
|
The recommended development environment requires [Docker](https://docs.docker.com/install/). While you can [initialize Dapr without a dependency on Docker]({{< ref self-hosted-no-docker.md >}})), the next steps in this guide assume the recommended Docker development environment.
|
||||||
|
|
||||||
You can also install [Podman](https://podman.io/) in place of Docker. Read more about [initializing Dapr using Podman]({{<ref dapr-init.md>}}).
|
You can also install [Podman](https://podman.io/) in place of Docker. Read more about [initializing Dapr using Podman]({{< ref dapr-init.md >}}).
|
||||||
{{% /alert %}}
|
{{% /alert %}}
|
||||||
|
|
||||||
### Step 1: Open an elevated terminal
|
### Step 1: Open an elevated terminal
|
||||||
|
@ -54,12 +54,35 @@ Run Windows Terminal or command prompt as administrator.
|
||||||
|
|
||||||
### Step 2: Run the init CLI command
|
### Step 2: Run the init CLI command
|
||||||
|
|
||||||
|
{{< tabs "Linux/MacOS" "Windows">}}
|
||||||
|
|
||||||
|
{{% codetab %}}
|
||||||
|
|
||||||
Install the latest Dapr runtime binaries:
|
Install the latest Dapr runtime binaries:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
dapr init
|
dapr init
|
||||||
```
|
```
|
||||||
|
|
||||||
|
**If you are installing on Mac OS Silicon with Docker,** you may need to perform the following workaround to enable `dapr init` to talk to Docker without using Kubernetes.
|
||||||
|
1. Navigate to **Docker Desktop** > **Settings** > **Advanced**.
|
||||||
|
1. Select the **Enable default Docker socket** checkbox.
|
||||||
|
|
||||||
|
{{% /codetab %}}
|
||||||
|
|
||||||
|
{{% codetab %}}
|
||||||
|
|
||||||
|
Install the latest Dapr runtime binaries:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
dapr init
|
||||||
|
```
|
||||||
|
|
||||||
|
{{% /codetab %}}
|
||||||
|
|
||||||
|
{{< /tabs >}}
|
||||||
|
|
||||||
|
|
||||||
### Step 3: Verify Dapr version
|
### Step 3: Verify Dapr version
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
|
|
@ -51,6 +51,20 @@ From the root of the Quickstarts directory, navigate into the pub/sub directory:
|
||||||
cd pub_sub/python/sdk
|
cd pub_sub/python/sdk
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Install the dependencies for the `order-processor` and `checkout` apps:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cd ./checkout
|
||||||
|
pip3 install -r requirements.txt
|
||||||
|
cd ..
|
||||||
|
cd ./order-processor
|
||||||
|
pip3 install -r requirements.txt
|
||||||
|
cd ..
|
||||||
|
cd ./order-processor-fastapi
|
||||||
|
pip3 install -r requirements.txt
|
||||||
|
cd ..
|
||||||
|
```
|
||||||
|
|
||||||
### Step 3: Run the publisher and subscriber
|
### Step 3: Run the publisher and subscriber
|
||||||
|
|
||||||
With the following command, simultaneously run the following services alongside their own Dapr sidecars:
|
With the following command, simultaneously run the following services alongside their own Dapr sidecars:
|
||||||
|
@ -215,6 +229,17 @@ From the root of the Quickstarts directory, navigate into the pub/sub directory:
|
||||||
cd pub_sub/javascript/sdk
|
cd pub_sub/javascript/sdk
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Install the dependencies for the `order-processor` and `checkout` apps:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cd ./order-processor
|
||||||
|
npm install
|
||||||
|
cd ..
|
||||||
|
cd ./checkout
|
||||||
|
npm install
|
||||||
|
cd ..
|
||||||
|
```
|
||||||
|
|
||||||
### Step 3: Run the publisher and subscriber
|
### Step 3: Run the publisher and subscriber
|
||||||
|
|
||||||
With the following command, simultaneously run the following services alongside their own Dapr sidecars:
|
With the following command, simultaneously run the following services alongside their own Dapr sidecars:
|
||||||
|
@ -352,6 +377,18 @@ From the root of the Quickstarts directory, navigate into the pub/sub directory:
|
||||||
cd pub_sub/csharp/sdk
|
cd pub_sub/csharp/sdk
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Install the dependencies for the `order-processor` and `checkout` apps:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cd ./order-processor
|
||||||
|
dotnet restore
|
||||||
|
dotnet build
|
||||||
|
cd ../checkout
|
||||||
|
dotnet restore
|
||||||
|
dotnet build
|
||||||
|
cd ..
|
||||||
|
```
|
||||||
|
|
||||||
### Step 3: Run the publisher and subscriber
|
### Step 3: Run the publisher and subscriber
|
||||||
|
|
||||||
With the following command, simultaneously run the following services alongside their own Dapr sidecars:
|
With the following command, simultaneously run the following services alongside their own Dapr sidecars:
|
||||||
|
@ -497,6 +534,17 @@ From the root of the Quickstarts directory, navigate into the pub/sub directory:
|
||||||
cd pub_sub/java/sdk
|
cd pub_sub/java/sdk
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Install the dependencies for the `order-processor` and `checkout` apps:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cd ./order-processor
|
||||||
|
mvn clean install
|
||||||
|
cd ..
|
||||||
|
cd ./checkout
|
||||||
|
mvn clean install
|
||||||
|
cd ..
|
||||||
|
```
|
||||||
|
|
||||||
### Step 3: Run the publisher and subscriber
|
### Step 3: Run the publisher and subscriber
|
||||||
|
|
||||||
With the following command, simultaneously run the following services alongside their own Dapr sidecars:
|
With the following command, simultaneously run the following services alongside their own Dapr sidecars:
|
||||||
|
@ -647,6 +695,16 @@ From the root of the Quickstarts directory, navigate into the pub/sub directory:
|
||||||
cd pub_sub/go/sdk
|
cd pub_sub/go/sdk
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Install the dependencies for the `order-processor` and `checkout` apps:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cd ./order-processor
|
||||||
|
go build .
|
||||||
|
cd ../checkout
|
||||||
|
go build .
|
||||||
|
cd ..
|
||||||
|
```
|
||||||
|
|
||||||
### Step 3: Run the publisher and subscriber
|
### Step 3: Run the publisher and subscriber
|
||||||
|
|
||||||
With the following command, simultaneously run the following services alongside their own Dapr sidecars:
|
With the following command, simultaneously run the following services alongside their own Dapr sidecars:
|
||||||
|
|
|
@ -48,6 +48,16 @@ From the root of the Quickstart clone directory, navigate to the quickstart dire
|
||||||
cd service_invocation/python/http
|
cd service_invocation/python/http
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Install the dependencies for the `order-processor` and `checkout` apps:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cd ./order-processor
|
||||||
|
pip3 install -r requirements.txt
|
||||||
|
cd ../checkout
|
||||||
|
pip3 install -r requirements.txt
|
||||||
|
cd ..
|
||||||
|
```
|
||||||
|
|
||||||
### Step 3: Run the `order-processor` and `checkout` services
|
### Step 3: Run the `order-processor` and `checkout` services
|
||||||
|
|
||||||
With the following command, simultaneously run the following services alongside their own Dapr sidecars:
|
With the following command, simultaneously run the following services alongside their own Dapr sidecars:
|
||||||
|
@ -184,6 +194,16 @@ From the root of the Quickstart clone directory, navigate to the quickstart dire
|
||||||
cd service_invocation/javascript/http
|
cd service_invocation/javascript/http
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Install the dependencies for the `order-processor` and `checkout` apps:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cd ./order-processor
|
||||||
|
npm install
|
||||||
|
cd ../checkout
|
||||||
|
npm install
|
||||||
|
cd ..
|
||||||
|
```
|
||||||
|
|
||||||
### Step 3: Run the `order-processor` and `checkout` services
|
### Step 3: Run the `order-processor` and `checkout` services
|
||||||
|
|
||||||
With the following command, simultaneously run the following services alongside their own Dapr sidecars:
|
With the following command, simultaneously run the following services alongside their own Dapr sidecars:
|
||||||
|
@ -314,6 +334,18 @@ From the root of the Quickstart clone directory, navigate to the quickstart dire
|
||||||
cd service_invocation/csharp/http
|
cd service_invocation/csharp/http
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Install the dependencies for the `order-processor` and `checkout` apps:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cd ./order-processor
|
||||||
|
dotnet restore
|
||||||
|
dotnet build
|
||||||
|
cd ../checkout
|
||||||
|
dotnet restore
|
||||||
|
dotnet build
|
||||||
|
cd ..
|
||||||
|
```
|
||||||
|
|
||||||
### Step 3: Run the `order-processor` and `checkout` services
|
### Step 3: Run the `order-processor` and `checkout` services
|
||||||
|
|
||||||
With the following command, simultaneously run the following services alongside their own Dapr sidecars:
|
With the following command, simultaneously run the following services alongside their own Dapr sidecars:
|
||||||
|
@ -448,6 +480,16 @@ From the root of the Quickstart clone directory, navigate to the quickstart dire
|
||||||
cd service_invocation/java/http
|
cd service_invocation/java/http
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Install the dependencies for the `order-processor` and `checkout` apps:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cd ./order-processor
|
||||||
|
mvn clean install
|
||||||
|
cd ../checkout
|
||||||
|
mvn clean install
|
||||||
|
cd ..
|
||||||
|
```
|
||||||
|
|
||||||
### Step 3: Run the `order-processor` and `checkout` services
|
### Step 3: Run the `order-processor` and `checkout` services
|
||||||
|
|
||||||
With the following command, simultaneously run the following services alongside their own Dapr sidecars:
|
With the following command, simultaneously run the following services alongside their own Dapr sidecars:
|
||||||
|
@ -577,6 +619,16 @@ From the root of the Quickstart clone directory, navigate to the quickstart dire
|
||||||
cd service_invocation/go/http
|
cd service_invocation/go/http
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Install the dependencies for the `order-processor` and `checkout` apps:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cd ./order-processor
|
||||||
|
go build .
|
||||||
|
cd ../checkout
|
||||||
|
go build .
|
||||||
|
cd ..
|
||||||
|
```
|
||||||
|
|
||||||
### Step 3: Run the `order-processor` and `checkout` services
|
### Step 3: Run the `order-processor` and `checkout` services
|
||||||
|
|
||||||
With the following command, simultaneously run the following services alongside their own Dapr sidecars:
|
With the following command, simultaneously run the following services alongside their own Dapr sidecars:
|
||||||
|
|
|
@ -48,6 +48,12 @@ In a terminal window, navigate to the `order-processor` directory.
|
||||||
cd state_management/python/sdk/order-processor
|
cd state_management/python/sdk/order-processor
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Install the dependencies:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
pip3 install -r requirements.txt
|
||||||
|
```
|
||||||
|
|
||||||
Run the `order-processor` service alongside a Dapr sidecar using [Multi-App Run]({{< ref multi-app-dapr-run >}}).
|
Run the `order-processor` service alongside a Dapr sidecar using [Multi-App Run]({{< ref multi-app-dapr-run >}}).
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
@ -163,6 +169,14 @@ Clone the [sample provided in the Quickstarts repo](https://github.com/dapr/quic
|
||||||
git clone https://github.com/dapr/quickstarts.git
|
git clone https://github.com/dapr/quickstarts.git
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Install the dependencies for the `order-processor` app:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cd ./order-processor
|
||||||
|
npm install
|
||||||
|
cd ..
|
||||||
|
```
|
||||||
|
|
||||||
### Step 2: Manipulate service state
|
### Step 2: Manipulate service state
|
||||||
|
|
||||||
In a terminal window, navigate to the `order-processor` directory.
|
In a terminal window, navigate to the `order-processor` directory.
|
||||||
|
@ -171,6 +185,12 @@ In a terminal window, navigate to the `order-processor` directory.
|
||||||
cd state_management/javascript/sdk/order-processor
|
cd state_management/javascript/sdk/order-processor
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Install the dependencies:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
npm install
|
||||||
|
```
|
||||||
|
|
||||||
Run the `order-processor` service alongside a Dapr sidecar.
|
Run the `order-processor` service alongside a Dapr sidecar.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
@ -297,6 +317,13 @@ In a terminal window, navigate to the `order-processor` directory.
|
||||||
cd state_management/csharp/sdk/order-processor
|
cd state_management/csharp/sdk/order-processor
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Install the dependencies:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
dotnet restore
|
||||||
|
dotnet build
|
||||||
|
```
|
||||||
|
|
||||||
Run the `order-processor` service alongside a Dapr sidecar.
|
Run the `order-processor` service alongside a Dapr sidecar.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
@ -557,6 +584,12 @@ In a terminal window, navigate to the `order-processor` directory.
|
||||||
cd state_management/go/sdk/order-processor
|
cd state_management/go/sdk/order-processor
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Install the dependencies:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
go build .
|
||||||
|
```
|
||||||
|
|
||||||
Run the `order-processor` service alongside a Dapr sidecar.
|
Run the `order-processor` service alongside a Dapr sidecar.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
|
Loading…
Reference in New Issue