mirror of https://github.com/dapr/docs.git
Merge branch 'v1.10' of https://github.com/dapr/docs into issue_2873
This commit is contained in:
commit
e67a7287b6
|
@ -49,10 +49,10 @@ For a detailed list of all available arguments run `daprd --help` or see this [t
|
|||
daprd --app-id --app-port 5000
|
||||
```
|
||||
|
||||
3. If you are using several custom components and want to specify the location of the component definition files, use the `--components-path` argument:
|
||||
3. If you are using several custom resources and want to specify the location of the resource definition files, use the `--resources-path` argument:
|
||||
|
||||
```bash
|
||||
daprd --app-id myapp --components-path <PATH-TO-COMPONENTS-FILES>
|
||||
daprd --app-id myapp --resources-path <PATH-TO-RESOURCES-FILES>
|
||||
```
|
||||
|
||||
4. Enable collection of Prometheus metrics while running your app
|
||||
|
|
|
@ -35,7 +35,7 @@ Create a new binding component named `checkout`. Within the `metadata` section,
|
|||
|
||||
{{% codetab %}}
|
||||
|
||||
Use the `--components-path` flag with `dapr run` to point to your custom components directory.
|
||||
Use the `--resources-path` flag with `dapr run` to point to your custom resources directory.
|
||||
|
||||
```yaml
|
||||
apiVersion: dapr.io/v1alpha1
|
||||
|
|
|
@ -41,7 +41,7 @@ Create a new binding component named `checkout`. Within the `metadata` section,
|
|||
|
||||
{{% codetab %}}
|
||||
|
||||
Use the `--components-path` flag with the `dapr run` command to point to your custom components directory.
|
||||
Use the `--resources-path` flag with the `dapr run` command to point to your custom resources directory.
|
||||
|
||||
```yaml
|
||||
apiVersion: dapr.io/v1alpha1
|
||||
|
|
|
@ -304,7 +304,7 @@ asyncio.run(executeConfiguration())
|
|||
```
|
||||
|
||||
```bash
|
||||
dapr run --app-id orderprocessing --components-path components/ -- python3 OrderProcessingService.py
|
||||
dapr run --app-id orderprocessing --resources-path components/ -- python3 OrderProcessingService.py
|
||||
```
|
||||
|
||||
{{% /codetab %}}
|
||||
|
|
|
@ -63,14 +63,14 @@ scopes:
|
|||
- checkout
|
||||
```
|
||||
|
||||
You can override this file with another [pubsub component]({{< ref setup-pubsub >}}) by creating a components directory (in this example, `myComponents`) containing the file and using the flag `--components-path` with the `dapr run` CLI command.
|
||||
You can override this file with another [pubsub component]({{< ref setup-pubsub >}}) by creating a components directory (in this example, `myComponents`) containing the file and using the flag `--resources-path` with the `dapr run` CLI command.
|
||||
|
||||
{{< tabs Dotnet Java Python Go Javascript >}}
|
||||
|
||||
{{% codetab %}}
|
||||
|
||||
```bash
|
||||
dapr run --app-id myapp --components-path ./myComponents -- dotnet run
|
||||
dapr run --app-id myapp --resources-path ./myComponents -- dotnet run
|
||||
```
|
||||
|
||||
{{% /codetab %}}
|
||||
|
@ -78,7 +78,7 @@ dapr run --app-id myapp --components-path ./myComponents -- dotnet run
|
|||
{{% codetab %}}
|
||||
|
||||
```bash
|
||||
dapr run --app-id myapp --components-path ./myComponents -- mvn spring-boot:run
|
||||
dapr run --app-id myapp --resources-path ./myComponents -- mvn spring-boot:run
|
||||
```
|
||||
|
||||
{{% /codetab %}}
|
||||
|
@ -86,7 +86,7 @@ dapr run --app-id myapp --components-path ./myComponents -- mvn spring-boot:run
|
|||
{{% codetab %}}
|
||||
|
||||
```bash
|
||||
dapr run --app-id myapp --components-path ./myComponents -- python3 app.py
|
||||
dapr run --app-id myapp --resources-path ./myComponents -- python3 app.py
|
||||
```
|
||||
|
||||
{{% /codetab %}}
|
||||
|
@ -94,7 +94,7 @@ dapr run --app-id myapp --components-path ./myComponents -- python3 app.py
|
|||
{{% codetab %}}
|
||||
|
||||
```bash
|
||||
dapr run --app-id myapp --components-path ./myComponents -- go run app.go
|
||||
dapr run --app-id myapp --resources-path ./myComponents -- go run app.go
|
||||
```
|
||||
|
||||
{{% /codetab %}}
|
||||
|
@ -102,7 +102,7 @@ dapr run --app-id myapp --components-path ./myComponents -- go run app.go
|
|||
{{% codetab %}}
|
||||
|
||||
```bash
|
||||
dapr run --app-id myapp --components-path ./myComponents -- npm start
|
||||
dapr run --app-id myapp --resources-path ./myComponents -- npm start
|
||||
```
|
||||
{{% /codetab %}}
|
||||
|
||||
|
|
|
@ -47,7 +47,7 @@ When running Dapr, set the YAML component file path to point Dapr to the compone
|
|||
{{% codetab %}}
|
||||
|
||||
```bash
|
||||
dapr run --app-id myapp --components-path ./myComponents -- dotnet run
|
||||
dapr run --app-id myapp --resources-path ./myComponents -- dotnet run
|
||||
```
|
||||
|
||||
{{% /codetab %}}
|
||||
|
@ -55,7 +55,7 @@ dapr run --app-id myapp --components-path ./myComponents -- dotnet run
|
|||
{{% codetab %}}
|
||||
|
||||
```bash
|
||||
dapr run --app-id myapp --components-path ./myComponents -- mvn spring-boot:run
|
||||
dapr run --app-id myapp --resources-path ./myComponents -- mvn spring-boot:run
|
||||
```
|
||||
|
||||
{{% /codetab %}}
|
||||
|
@ -63,7 +63,7 @@ dapr run --app-id myapp --components-path ./myComponents -- mvn spring-boot:run
|
|||
{{% codetab %}}
|
||||
|
||||
```bash
|
||||
dapr run --app-id myapp --components-path ./myComponents -- python3 app.py
|
||||
dapr run --app-id myapp --resources-path ./myComponents -- python3 app.py
|
||||
```
|
||||
|
||||
{{% /codetab %}}
|
||||
|
@ -71,7 +71,7 @@ dapr run --app-id myapp --components-path ./myComponents -- python3 app.py
|
|||
{{% codetab %}}
|
||||
|
||||
```bash
|
||||
dapr run --app-id myapp --components-path ./myComponents -- npm start
|
||||
dapr run --app-id myapp --resources-path ./myComponents -- npm start
|
||||
```
|
||||
|
||||
{{% /codetab %}}
|
||||
|
@ -79,7 +79,7 @@ dapr run --app-id myapp --components-path ./myComponents -- npm start
|
|||
{{% codetab %}}
|
||||
|
||||
```bash
|
||||
dapr run --app-id myapp --components-path ./myComponents -- go run app.go
|
||||
dapr run --app-id myapp --resources-path ./myComponents -- go run app.go
|
||||
```
|
||||
|
||||
{{% /codetab %}}
|
||||
|
|
|
@ -96,7 +96,7 @@ docker run -d --rm -p 27017:27017 --name mongodb mongo:5
|
|||
Next, start a Dapr application. Refer to the [component configuration file](../query-api-examples/components/mongodb/mongodb.yml), which instructs Dapr to use MongoDB as its state store.
|
||||
|
||||
```bash
|
||||
dapr run --app-id demo --dapr-http-port 3500 --components-path query-api-examples/components/mongodb
|
||||
dapr run --app-id demo --dapr-http-port 3500 --resources-path query-api-examples/components/mongodb
|
||||
```
|
||||
|
||||
Populate the state store with the employee dataset, so you can query it later.
|
||||
|
|
|
@ -33,7 +33,7 @@ To create a dedicated components folder with the default `statestore`, `pubsub`,
|
|||
1. Open your application directory in Visual Studio Code
|
||||
2. Open the Command Palette with `Ctrl+Shift+P`
|
||||
3. Select `Dapr: Scaffold Dapr Components`
|
||||
4. Run your application with `dapr run --components-path ./components -- ...`
|
||||
4. Run your application with `dapr run --resources-path ./components -- ...`
|
||||
|
||||
### View running Dapr applications
|
||||
|
||||
|
|
|
@ -85,7 +85,7 @@ pip3 install -r requirements.txt
|
|||
Run the `batch-sdk` service alongside a Dapr sidecar.
|
||||
|
||||
```bash
|
||||
dapr run --app-id batch-sdk --app-port 50051 --components-path ../../../components -- python3 app.py
|
||||
dapr run --app-id batch-sdk --app-port 50051 --resources-path ../../../components -- python3 app.py
|
||||
```
|
||||
|
||||
> **Note**: Since Python3.exe is not defined in Windows, you may need to use `python app.py` instead of `python3 app.py`.
|
||||
|
@ -292,7 +292,7 @@ npm install
|
|||
Run the `batch-sdk` service alongside a Dapr sidecar.
|
||||
|
||||
```bash
|
||||
dapr run --app-id batch-sdk --app-port 5002 --dapr-http-port 3500 --components-path ../../../components -- node index.js
|
||||
dapr run --app-id batch-sdk --app-port 5002 --dapr-http-port 3500 --resources-path ../../../components -- node index.js
|
||||
```
|
||||
|
||||
The code inside the `process_batch` function is executed every 10 seconds (defined in [`binding-cron.yaml`]({{< ref "#componentsbinding-cronyaml-component-file" >}}) in the `components` directory). The binding trigger looks for a route called via HTTP POST in your Flask application by the Dapr sidecar.
|
||||
|
@ -495,7 +495,7 @@ dotnet build batch.csproj
|
|||
Run the `batch-sdk` service alongside a Dapr sidecar.
|
||||
|
||||
```bash
|
||||
dapr run --app-id batch-sdk --app-port 7002 --components-path ../../../components -- dotnet run
|
||||
dapr run --app-id batch-sdk --app-port 7002 --resources-path ../../../components -- dotnet run
|
||||
```
|
||||
|
||||
The code inside the `process_batch` function is executed every 10 seconds (defined in [`binding-cron.yaml`]({{< ref "#componentsbinding-cronyaml-component-file" >}}) in the `components` directory). The binding trigger looks for a route called via HTTP POST in your Flask application by the Dapr sidecar.
|
||||
|
@ -701,7 +701,7 @@ mvn clean install
|
|||
Run the `batch-sdk` service alongside a Dapr sidecar.
|
||||
|
||||
```bash
|
||||
dapr run --app-id batch-sdk --app-port 8080 --components-path ../../../components -- java -jar target/BatchProcessingService-0.0.1-SNAPSHOT.jar
|
||||
dapr run --app-id batch-sdk --app-port 8080 --resources-path ../../../components -- java -jar target/BatchProcessingService-0.0.1-SNAPSHOT.jar
|
||||
```
|
||||
|
||||
The code inside the `process_batch` function is executed every 10 seconds (defined in [`binding-cron.yaml`]({{< ref "#componentsbinding-cronyaml-component-file" >}}) in the `components` directory). The binding trigger looks for a route called via HTTP POST in your Flask application by the Dapr sidecar.
|
||||
|
@ -908,7 +908,7 @@ go build .
|
|||
Run the `batch-sdk` service alongside a Dapr sidecar.
|
||||
|
||||
```bash
|
||||
dapr run --app-id batch-sdk --app-port 6002 --dapr-http-port 3502 --dapr-grpc-port 60002 --components-path ../../../components -- go run .
|
||||
dapr run --app-id batch-sdk --app-port 6002 --dapr-http-port 3502 --dapr-grpc-port 60002 --resources-path ../../../components -- go run .
|
||||
```
|
||||
|
||||
The code inside the `process_batch` function is executed every 10 seconds (defined in [`binding-cron.yaml`]({{< ref "#componentsbinding-cronyaml-component-file" >}}) in the `components` directory). The binding trigger looks for a route called via HTTP POST in your Flask application by the Dapr sidecar.
|
||||
|
|
|
@ -56,7 +56,7 @@ pip3 install -r requirements.txt
|
|||
Run the `order-processor` subscriber service alongside a Dapr sidecar.
|
||||
|
||||
```bash
|
||||
dapr run --app-id order-processor --components-path ../../../components/ --app-port 5001 -- python3 app.py
|
||||
dapr run --app-id order-processor --resources-path ../../../components/ --app-port 5001 -- python3 app.py
|
||||
```
|
||||
|
||||
> **Note**: Since Python3.exe is not defined in Windows, you may need to use `python app.py` instead of `python3 app.py`.
|
||||
|
@ -105,7 +105,7 @@ pip3 install -r requirements.txt
|
|||
Run the `checkout` publisher service alongside a Dapr sidecar.
|
||||
|
||||
```bash
|
||||
dapr run --app-id checkout --components-path ../../../components/ -- python3 app.py
|
||||
dapr run --app-id checkout --resources-path ../../../components/ -- python3 app.py
|
||||
```
|
||||
|
||||
> **Note**: Since Python3.exe is not defined in Windows, you may need to use `python app.py` instead of `python3 app.py`.
|
||||
|
@ -235,7 +235,7 @@ Verify you have the following files included in the service directory:
|
|||
Run the `order-processor` subscriber service alongside a Dapr sidecar.
|
||||
|
||||
```bash
|
||||
dapr run --app-port 5001 --app-id order-processing --app-protocol http --dapr-http-port 3501 --components-path ../../../components -- npm run start
|
||||
dapr run --app-port 5001 --app-id order-processing --app-protocol http --dapr-http-port 3501 --resources-path ../../../components -- npm run start
|
||||
```
|
||||
|
||||
In the `order-processor` subscriber, we're subscribing to the Redis instance called `orderpubsub` [(as defined in the `pubsub.yaml` component)]({{< ref "#pubsubyaml-component-file" >}}) and topic `orders`. This enables your app code to talk to the Redis component instance through the Dapr sidecar.
|
||||
|
@ -267,7 +267,7 @@ Verify you have the following files included in the service directory:
|
|||
Run the `checkout` publisher service alongside a Dapr sidecar.
|
||||
|
||||
```bash
|
||||
dapr run --app-id checkout --app-protocol http --dapr-http-port 3500 --components-path ../../../components -- npm run start
|
||||
dapr run --app-id checkout --app-protocol http --dapr-http-port 3500 --resources-path ../../../components -- npm run start
|
||||
```
|
||||
|
||||
In the `checkout` publisher service, we're publishing the orderId message to the Redis instance called `orderpubsub` [(as defined in the `pubsub.yaml` component)]({{< ref "#pubsubyaml-component-file" >}}) and topic `orders`. As soon as the service starts, it publishes in a loop:
|
||||
|
@ -389,7 +389,7 @@ dotnet build
|
|||
Run the `order-processor` subscriber service alongside a Dapr sidecar.
|
||||
|
||||
```bash
|
||||
dapr run --app-id order-processor --components-path ../../../components --app-port 7002 -- dotnet run
|
||||
dapr run --app-id order-processor --resources-path ../../../components --app-port 7002 -- dotnet run
|
||||
```
|
||||
|
||||
In the `order-processor` subscriber, we're subscribing to the Redis instance called `orderpubsub` [(as defined in the `pubsub.yaml` component)]({{< ref "#pubsubyaml-component-file" >}}) and topic `orders`. This enables your app code to talk to the Redis component instance through the Dapr sidecar.
|
||||
|
@ -423,7 +423,7 @@ dotnet build
|
|||
Run the `checkout` publisher service alongside a Dapr sidecar.
|
||||
|
||||
```bash
|
||||
dapr run --app-id checkout --components-path ../../../components -- dotnet run
|
||||
dapr run --app-id checkout --resources-path ../../../components -- dotnet run
|
||||
```
|
||||
|
||||
In the `checkout` publisher, we're publishing the orderId message to the Redis instance called `orderpubsub` [(as defined in the `pubsub.yaml` component)]({{< ref "#pubsubyaml-component-file" >}}) and topic `orders`. As soon as the service starts, it publishes in a loop:
|
||||
|
@ -544,7 +544,7 @@ mvn clean install
|
|||
Run the `order-processor` subscriber service alongside a Dapr sidecar.
|
||||
|
||||
```bash
|
||||
dapr run --app-port 8080 --app-id order-processor --components-path ../../../components -- java -jar target/OrderProcessingService-0.0.1-SNAPSHOT.jar
|
||||
dapr run --app-port 8080 --app-id order-processor --resources-path ../../../components -- java -jar target/OrderProcessingService-0.0.1-SNAPSHOT.jar
|
||||
```
|
||||
|
||||
In the `order-processor` subscriber, we're subscribing to the Redis instance called `orderpubsub` [(as defined in the `pubsub.yaml` component)]({{< ref "#pubsubyaml-component-file" >}}) and topic `orders`. This enables your app code to talk to the Redis component instance through the Dapr sidecar.
|
||||
|
@ -582,7 +582,7 @@ mvn clean install
|
|||
Run the `checkout` publisher service alongside a Dapr sidecar.
|
||||
|
||||
```bash
|
||||
dapr run --app-id checkout --components-path ../../../components -- java -jar target/CheckoutService-0.0.1-SNAPSHOT.jar
|
||||
dapr run --app-id checkout --resources-path ../../../components -- java -jar target/CheckoutService-0.0.1-SNAPSHOT.jar
|
||||
```
|
||||
|
||||
In the `checkout` publisher, we're publishing the orderId message to the Redis instance called `orderpubsub` [(as defined in the `pubsub.yaml` component)]({{< ref "#pubsubyaml-component-file" >}}) and topic `orders`. As soon as the service starts, it publishes in a loop:
|
||||
|
@ -706,7 +706,7 @@ go build .
|
|||
Run the `order-processor` subscriber service alongside a Dapr sidecar.
|
||||
|
||||
```bash
|
||||
dapr run --app-port 6002 --app-id order-processor-sdk --app-protocol http --dapr-http-port 3501 --components-path ../../../components -- go run .
|
||||
dapr run --app-port 6002 --app-id order-processor-sdk --app-protocol http --dapr-http-port 3501 --resources-path ../../../components -- go run .
|
||||
```
|
||||
|
||||
In the `order-processor` subscriber, we're subscribing to the Redis instance called `orderpubsub` [(as defined in the `pubsub.yaml` component)]({{< ref "#pubsubyaml-component-file" >}}) and topic `orders`. This enables your app code to talk to the Redis component instance through the Dapr sidecar.
|
||||
|
@ -736,7 +736,7 @@ go build .
|
|||
Run the `checkout` publisher service alongside a Dapr sidecar.
|
||||
|
||||
```bash
|
||||
dapr run --app-id checkout --app-protocol http --dapr-http-port 3500 --components-path ../../../components -- go run .
|
||||
dapr run --app-id checkout --app-protocol http --dapr-http-port 3500 --resources-path ../../../components -- go run .
|
||||
```
|
||||
|
||||
In the `checkout` publisher, we're publishing the orderId message to the Redis instance called `orderpubsub` [(as defined in the `pubsub.yaml` component)]({{< ref "#pubsubyaml-component-file" >}}) and topic `orders`. As soon as the service starts, it publishes in a loop:
|
||||
|
|
|
@ -55,7 +55,7 @@ pip3 install -r requirements.txt
|
|||
Run the `order-processor` service alongside a Dapr sidecar.
|
||||
|
||||
```bash
|
||||
dapr run --app-id order-processor --components-path ../../../components/ -- python3 app.py
|
||||
dapr run --app-id order-processor --resources-path ../../../components/ -- python3 app.py
|
||||
```
|
||||
|
||||
> **Note**: Since Python3.exe is not defined in Windows, you may need to use `python app.py` instead of `python3 app.py`.
|
||||
|
@ -164,7 +164,7 @@ npm install
|
|||
Run the `order-processor` service alongside a Dapr sidecar.
|
||||
|
||||
```bash
|
||||
dapr run --app-id order-processor --components-path ../../../components/ -- npm start
|
||||
dapr run --app-id order-processor --resources-path ../../../components/ -- npm start
|
||||
```
|
||||
|
||||
#### Behind the scenes
|
||||
|
@ -278,7 +278,7 @@ dotnet build
|
|||
Run the `order-processor` service alongside a Dapr sidecar.
|
||||
|
||||
```bash
|
||||
dapr run --app-id order-processor --components-path ../../../components/ -- dotnet run
|
||||
dapr run --app-id order-processor --resources-path ../../../components/ -- dotnet run
|
||||
```
|
||||
|
||||
#### Behind the scenes
|
||||
|
@ -389,7 +389,7 @@ mvn clean install
|
|||
Run the `order-processor` service alongside a Dapr sidecar.
|
||||
|
||||
```bash
|
||||
dapr run --app-id order-processor --components-path ../../../components/ -- java -jar target/OrderProcessingService-0.0.1-SNAPSHOT.jar
|
||||
dapr run --app-id order-processor --resources-path ../../../components/ -- java -jar target/OrderProcessingService-0.0.1-SNAPSHOT.jar
|
||||
```
|
||||
|
||||
#### Behind the scenes
|
||||
|
@ -494,7 +494,7 @@ go build .
|
|||
Run the `order-processor` service alongside a Dapr sidecar.
|
||||
|
||||
```bash
|
||||
dapr run --app-id order-processor --components-path ../../../components/ -- go run .
|
||||
dapr run --app-id order-processor --resources-path ../../../components/ -- go run .
|
||||
```
|
||||
|
||||
#### Behind the scenes
|
||||
|
|
|
@ -51,7 +51,7 @@ pip3 install -r requirements.txt
|
|||
Run the `order-processor` service alongside a Dapr sidecar.
|
||||
|
||||
```bash
|
||||
dapr run --app-id order-processor --components-path ../../../components/ -- python3 app.py
|
||||
dapr run --app-id order-processor --resources-path ../../../components/ -- python3 app.py
|
||||
```
|
||||
|
||||
> **Note**: Since Python3.exe is not defined in Windows, you may need to use `python app.py` instead of `python3 app.py`.
|
||||
|
@ -172,7 +172,7 @@ Verify you have the following files included in the service directory:
|
|||
Run the `order-processor` service alongside a Dapr sidecar.
|
||||
|
||||
```bash
|
||||
dapr run --app-id order-processor --components-path ../../../components/ -- npm run start
|
||||
dapr run --app-id order-processor --resources-path ../../../components/ -- npm run start
|
||||
```
|
||||
The `order-processor` service writes, reads, and deletes an `orderId` key/value pair to the `statestore` instance [defined in the `statestore.yaml` component]({{< ref "#statestoreyaml-component-file" >}}). As soon as the service starts, it performs a loop.
|
||||
|
||||
|
@ -300,7 +300,7 @@ dotnet build
|
|||
Run the `order-processor` service alongside a Dapr sidecar.
|
||||
|
||||
```bash
|
||||
dapr run --app-id order-processor --components-path ../../../components/ -- dotnet run
|
||||
dapr run --app-id order-processor --resources-path ../../../components/ -- dotnet run
|
||||
```
|
||||
|
||||
The `order-processor` service writes, reads, and deletes an `orderId` key/value pair to the `statestore` instance [defined in the `statestore.yaml` component]({{< ref "#statestoreyaml-component-file" >}}). As soon as the service starts, it performs a loop.
|
||||
|
@ -419,7 +419,7 @@ mvn clean install
|
|||
Run the `order-processor` service alongside a Dapr sidecar.
|
||||
|
||||
```bash
|
||||
dapr run --app-id order-processor --components-path ../../../components -- java -jar target/OrderProcessingService-0.0.1-SNAPSHOT.jar
|
||||
dapr run --app-id order-processor --resources-path ../../../components -- java -jar target/OrderProcessingService-0.0.1-SNAPSHOT.jar
|
||||
```
|
||||
|
||||
The `order-processor` service writes, reads, and deletes an `orderId` key/value pair to the `statestore` instance [defined in the `statestore.yaml` component]({{< ref "#statestoreyaml-component-file" >}}). As soon as the service starts, it performs a loop.
|
||||
|
@ -538,7 +538,7 @@ go build .
|
|||
Run the `order-processor` service alongside a Dapr sidecar.
|
||||
|
||||
```bash
|
||||
dapr run --app-id order-processor --components-path ../../../components -- go run .
|
||||
dapr run --app-id order-processor --resources-path ../../../components -- go run .
|
||||
```
|
||||
|
||||
The `order-processor` service writes, reads, and deletes an `orderId` key/value pair to the `statestore` instance [defined in the `statestore.yaml` component]({{< ref "#statestoreyaml-component-file" >}}). As soon as the service starts, it performs a loop.
|
||||
|
|
|
@ -317,9 +317,9 @@ When you run `dapr init`, Dapr creates a default redis `pubsub.yaml` on your loc
|
|||
For new component files:
|
||||
|
||||
1. Create a new `components` directory in your app folder containing the YAML files.
|
||||
1. Provide the path to the `dapr run` command with the flag `--components-path`
|
||||
1. Provide the path to the `dapr run` command with the flag `--resources-path`
|
||||
|
||||
If you initialized Dapr in [slim mode]({{< ref self-hosted-no-docker.md >}}) (without Docker), you need to manually create the default directory, or always specify a components directory using `--components-path`.
|
||||
If you initialized Dapr in [slim mode]({{< ref self-hosted-no-docker.md >}}) (without Docker), you need to manually create the default directory, or always specify a components directory using `--resources-path`.
|
||||
|
||||
{{% /codetab %}}
|
||||
|
||||
|
|
|
@ -65,7 +65,7 @@ In the above file definition:
|
|||
Launch a Dapr sidecar that will listen on port 3500 for a blank application named `myapp`:
|
||||
|
||||
```bash
|
||||
dapr run --app-id myapp --dapr-http-port 3500 --components-path ./my-components
|
||||
dapr run --app-id myapp --dapr-http-port 3500 --resources-path ./my-components
|
||||
```
|
||||
|
||||
{{% alert title="Tip" color="primary" %}}
|
||||
|
|
|
@ -44,7 +44,7 @@ spec:
|
|||
|
||||
### Special metadata values
|
||||
|
||||
Metadata values can contain a `{uuid}` tag that is replaced with a randomly generate UUID when the Dapr sidecar starts up. A new UUID is generated on every start up. It can be used, for example, to have a pod on Kubernetes with multiple application instances consuming a [shared MQTT subscription]({{< ref "setup-mqtt.md" >}}). Below is an example of using the `{uuid}` tag.
|
||||
Metadata values can contain a `{uuid}` tag that is replaced with a randomly generate UUID when the Dapr sidecar starts up. A new UUID is generated on every start up. It can be used, for example, to have a pod on Kubernetes with multiple application instances consuming a [shared MQTT subscription]({{< ref "setup-mqtt3.md" >}}). Below is an example of using the `{uuid}` tag.
|
||||
|
||||
```yaml
|
||||
apiVersion: dapr.io/v1alpha1
|
||||
|
@ -52,7 +52,7 @@ kind: Component
|
|||
metadata:
|
||||
name: messagebus
|
||||
spec:
|
||||
type: pubsub.mqtt
|
||||
type: pubsub.mqtt3
|
||||
version: v1
|
||||
metadata:
|
||||
- name: consumerID
|
||||
|
|
|
@ -62,7 +62,7 @@ Once you have created the component's YAML file, follow these instructions to ap
|
|||
{{< tabs "Self-Hosted" "Kubernetes" >}}
|
||||
|
||||
{{% codetab %}}
|
||||
To run locally, create a `components` dir containing the YAML file and provide the path to the `dapr run` command with the flag `--components-path`.
|
||||
To run locally, create a `components` dir containing the YAML file and provide the path to the `dapr run` command with the flag `--resources-path`.
|
||||
{{% /codetab %}}
|
||||
|
||||
{{% codetab %}}
|
||||
|
|
|
@ -65,7 +65,7 @@ Once you have created the component's YAML file, follow these instructions to ap
|
|||
{{< tabs "Self-Hosted" "Kubernetes" >}}
|
||||
|
||||
{{% codetab %}}
|
||||
To run locally, create a `components` dir containing the YAML file and provide the path to the `dapr run` command with the flag `--components-path`.
|
||||
To run locally, create a `components` dir containing the YAML file and provide the path to the `dapr run` command with the flag `--resources-path`.
|
||||
{{% /codetab %}}
|
||||
|
||||
{{% codetab %}}
|
||||
|
|
|
@ -48,6 +48,7 @@ The following configuration settings can be applied to Dapr application sidecars
|
|||
|
||||
- [Tracing](#tracing)
|
||||
- [Metrics](#metrics)
|
||||
- [Logging](#logging)
|
||||
- [Middleware](#middleware)
|
||||
- [Scope secret store access](#scope-secret-store-access)
|
||||
- [Access Control allow lists for building block APIs](#access-control-allow-lists-for-building-block-apis)
|
||||
|
@ -85,7 +86,7 @@ The following table lists the properties for tracing:
|
|||
`samplingRate` is used to enable or disable the tracing. To disable the sampling rate ,
|
||||
set `samplingRate : "0"` in the configuration. The valid range of samplingRate is between 0 and 1 inclusive. The sampling rate determines whether a trace span should be sampled or not based on value. `samplingRate : "1"` samples all traces. By default, the sampling rate is (0.0001) or 1 in 10,000 traces.
|
||||
|
||||
See [Observability distributed tracing]({{< ref "tracing-overview.md" >}}) for more information
|
||||
See [Observability distributed tracing]({{< ref "tracing-overview.md" >}}) for more information.
|
||||
|
||||
#### Metrics
|
||||
|
||||
|
@ -104,7 +105,29 @@ The following table lists the properties for metrics:
|
|||
|--------------|--------|-------------|
|
||||
| `enabled` | boolean | Whether metrics should to be enabled.
|
||||
|
||||
See [metrics documentation]({{< ref "metrics-overview.md" >}}) for more information
|
||||
See [metrics documentation]({{< ref "metrics-overview.md" >}}) for more information.
|
||||
|
||||
#### Logging
|
||||
|
||||
The logging section can be used to configure how logging works in the Dapr Runtime.
|
||||
|
||||
The `logging` section under the `Configuration` spec contains the following properties:
|
||||
|
||||
```yml
|
||||
logging:
|
||||
apiLogging:
|
||||
enabled: false
|
||||
omitHealthChecks: false
|
||||
```
|
||||
|
||||
The following table lists the properties for logging:
|
||||
|
||||
| Property | Type | Description |
|
||||
|--------------|--------|-------------|
|
||||
| `apiLogging.enabled` | boolean | The default value for the `--enable-api-logging` flag for `daprd` (and the corresponding `dapr.io/enable-api-logging` annotation): the value set in the Configuration spec is used as default unless a `true` or `false` value is passed to each Dapr Runtime. Default: `false`.
|
||||
| `apiLogging.omitHealthChecks` | boolean | If `true`, calls to health check endpoints (e.g. `/v1.0/healthz`) are not logged when API logging is enabled. This is useful if those calls are adding a lot of noise in your logs. Default: `false`
|
||||
|
||||
See [logging documentation]({{< ref "logs.md" >}}) for more information.
|
||||
|
||||
#### Middleware
|
||||
|
||||
|
@ -130,8 +153,8 @@ The following table lists the properties for HTTP handlers:
|
|||
|
||||
| Property | Type | Description |
|
||||
|----------|--------|-------------|
|
||||
| name | string | Name of the middleware component
|
||||
| type | string | Type of middleware component
|
||||
| `name` | string | Name of the middleware component
|
||||
| `type` | string | Type of middleware component
|
||||
|
||||
See [Middleware pipelines]({{< ref "middleware.md" >}}) for more information
|
||||
|
||||
|
|
|
@ -123,10 +123,10 @@ services:
|
|||
"--app-id", "nodeapp",
|
||||
"--app-port", "3000",
|
||||
"--placement-host-address", "placement:50006", # Dapr's placement service can be reach via the docker DNS entry
|
||||
"--components-path", "./components"
|
||||
"--resources-path", "./components"
|
||||
]
|
||||
volumes:
|
||||
- "./components/:/components" # Mount our components folder for the runtime to use. The mounted location must match the --components-path argument.
|
||||
- "./components/:/components" # Mount our components folder for the runtime to use. The mounted location must match the --resources-path argument.
|
||||
depends_on:
|
||||
- nodeapp
|
||||
network_mode: "service:nodeapp" # Attach the nodeapp-dapr service to the nodeapp network namespace
|
||||
|
|
|
@ -58,7 +58,7 @@ When using the Dapr CLI to run an application, pass the `--log-as-json` option t
|
|||
```sh
|
||||
dapr run \
|
||||
--app-id orderprocessing \
|
||||
--components-path ./components/ \
|
||||
--resources-path ./components/ \
|
||||
--log-as-json \
|
||||
-- python3 OrderProcessingService.py
|
||||
```
|
||||
|
@ -109,7 +109,9 @@ spec:
|
|||
|
||||
## API Logging
|
||||
|
||||
API logging enables you to see the API calls your application makes to the Dapr sidecar, to debug issues or monitor the behavior of your application. You can combine both Dapr API logging with Dapr log events. See [configure and view Dapr Logs]({{< ref "logs-troubleshooting.md" >}}) and [configure and view Dapr API Logs]({{< ref "api-logs-troubleshooting.md" >}}) for more information.
|
||||
API logging enables you to see the API calls your application makes to the Dapr sidecar, to debug issues or monitor the behavior of your application. You can combine both Dapr API logging with Dapr log events.
|
||||
|
||||
See [configure and view Dapr Logs]({{< ref "logs-troubleshooting.md" >}}) and [configure and view Dapr API Logs]({{< ref "api-logs-troubleshooting.md" >}}) for more information.
|
||||
|
||||
## Log collectors
|
||||
|
||||
|
|
|
@ -77,3 +77,37 @@ time="2022-03-16T18:32:02.917629403Z" level=info msg="HTTP API Called" method="P
|
|||
time="2022-03-16T18:32:03.137830112Z" level=info msg="HTTP API Called" method="POST /v1.0/invoke/{id}/method/{method:*}" app_id=invoke-caller instance=invokecaller-f4f949886-cbnmt scope=dapr.runtime.http-info type=log useragent=Go-http-client/1.1 ver=edge
|
||||
time="2022-03-16T18:32:03.359097916Z" level=info msg="HTTP API Called" method="POST /v1.0/invoke/{id}/method/{method:*}" app_id=invoke-caller instance=invokecaller-f4f949886-cbnmt scope=dapr.runtime.http-info type=log useragent=Go-http-client/1.1 ver=edge
|
||||
```
|
||||
|
||||
## API logging configuration
|
||||
|
||||
Using the [Dapr Configuration spec]({{< ref "configuration-overview.md" >}}#sidecar-configuration), you can configure the default behavior of API logging in Dapr runtimes.
|
||||
|
||||
### Enable API logging by default
|
||||
|
||||
Using the Dapr Configuration spec, you can set the default value for the `--enable-api-logging` flag (and the correspondent annotation when running on Kubernetes), with the `logging.apiLogging.enabled` option. This value applies to all Dapr runtimes that reference the Configuration document or resource in which it's defined.
|
||||
|
||||
- If `logging.apiLogging.enabled` is set to `false`, the default value, API logging is disabled for Dapr runtimes unless `--enable-api-logging` is set to `true` (or the `dapr.io/enable-api-logging: true` annotation is added).
|
||||
- When `logging.apiLogging.enabled` is `true`, Dapr runtimes have API logging enabled by default, and it can be disabled by setting
|
||||
`--enable-api-logging=false` or with the `dapr.io/enable-api-logging: false` annotation.
|
||||
|
||||
For example:
|
||||
|
||||
```yaml
|
||||
logging:
|
||||
apiLogging:
|
||||
enabled: true
|
||||
```
|
||||
|
||||
### Omit health checks from API logging
|
||||
|
||||
When API logging is enabled, all calls to the Dapr API server are logged, including those to health check endpoints (e.g. `/v1.0/healthz`). Depending on your environment, this may generate multiple log lines per minute and could create unwanted noise.
|
||||
|
||||
You can configure Dapr to not log calls to health check endpoints when API logging is enabled using the Dapr Configuration spec, by setting `logging.apiLogging.omitHealthChecks: true`. The default value is `false`, which means that health checks calls are logged in the API logs.
|
||||
|
||||
For example:
|
||||
|
||||
```yaml
|
||||
logging:
|
||||
apiLogging:
|
||||
omitHealthChecks: true
|
||||
```
|
||||
|
|
|
@ -225,7 +225,7 @@ export DAPR_HOST_IP=127.0.0.1
|
|||
This is usually due to one of the following issues
|
||||
|
||||
- You may have defined the `NAMESPACE` environment variable locally or deployed your components into a different namespace in Kubernetes. Check which namespace your app and the components are deployed to. Read [scoping components to one or more applications]({{< ref "component-scopes.md" >}}) for more information.
|
||||
- You may have not provided a `--components-path` with the Dapr `run` commands or not placed your components into the default components folder for your OS. Read [define a component]({{< ref "get-started-component.md" >}}) for more information.
|
||||
- You may have not provided a `--resources-path` with the Dapr `run` commands or not placed your components into the default components folder for your OS. Read [define a component]({{< ref "get-started-component.md" >}}) for more information.
|
||||
- You may have a syntax issue in component YAML file. Check your component YAML with the component [YAML samples]({{< ref "components.md" >}}).
|
||||
|
||||
## Service invocation is failing and my Dapr service is missing an appId (macOS)
|
||||
|
|
|
@ -16,7 +16,8 @@ This table is meant to help users understand the equivalent options for running
|
|||
| `--app-id` | `--app-id` | `-i` | `dapr.io/app-id` | The unique ID of the application. Used for service discovery, state encapsulation and the pub/sub consumer ID |
|
||||
| `--app-port` | `--app-port` | `-p` | `dapr.io/app-port` | This parameter tells Dapr which port your application is listening on |
|
||||
| `--app-ssl` | `--app-ssl` | | `dapr.io/app-ssl` | Sets the URI scheme of the app to https and attempts an SSL connection |
|
||||
| `--components-path` | `--components-path` | `-d` | not supported | Path for components directory. If empty, components will not be loaded. |
|
||||
| `--components-path` | `--components-path` | `-d` | not supported | **Deprecated** in favor of `--resources-path` |
|
||||
| `--resources-path` | `--resources-path` | `-d` | not supported | Path for components directory. If empty, components will not be loaded. |
|
||||
| `--config` | `--config` | `-c` | `dapr.io/config` | Tells Dapr which Configuration CRD to use |
|
||||
| `--control-plane-address` | not supported | | not supported | Address for a Dapr control plane |
|
||||
| `--dapr-grpc-port` | `--dapr-grpc-port` | | not supported | gRPC port for the Dapr API to listen on (default "50001") |
|
||||
|
|
|
@ -28,7 +28,8 @@ dapr run [flags] [command]
|
|||
| `--app-port`, `-p` | `APP_PORT` | | The port your application is listening on |
|
||||
| `--app-protocol`, `-P` | | `http` | The protocol Dapr uses to talk to the application. Valid values are: `http` or `grpc` |
|
||||
| `--app-ssl` | | `false` | Enable https when Dapr invokes the application |
|
||||
| `--components-path`, `-d` | | Linux/Mac: `$HOME/.dapr/components` <br/>Windows: `%USERPROFILE%\.dapr\components` | The path for components directory |
|
||||
| `--components-path`, `-d` | | Linux/Mac: `$HOME/.dapr/components` <br/>Windows: `%USERPROFILE%\.dapr\components` | **Deprecated** in favor of `--resources-path` |
|
||||
| `--resources-path`, `-d` | | Linux/Mac: `$HOME/.dapr/components` <br/>Windows: `%USERPROFILE%\.dapr\components` | The path for components directory |
|
||||
| `--config`, `-c` | | Linux/Mac: `$HOME/.dapr/config.yaml` <br/>Windows: `%USERPROFILE%\.dapr\config.yaml` | Dapr configuration file |
|
||||
| `--dapr-grpc-port` | `DAPR_GRPC_PORT` | `50001` | The gRPC port for Dapr to listen on |
|
||||
| `--dapr-http-port` | `DAPR_HTTP_PORT` | `3500` | The HTTP port for Dapr to listen on |
|
||||
|
|
|
@ -1,15 +1,16 @@
|
|||
---
|
||||
type: docs
|
||||
title: "MQTT binding spec"
|
||||
linkTitle: "MQTT"
|
||||
description: "Detailed documentation on the MQTT binding component"
|
||||
title: "MQTT3 binding spec"
|
||||
linkTitle: "MQTT3"
|
||||
description: "Detailed documentation on the MQTT3 binding component"
|
||||
aliases:
|
||||
- "/operations/components/setup-bindings/supported-bindings/mqtt3/"
|
||||
- "/operations/components/setup-bindings/supported-bindings/mqtt/"
|
||||
---
|
||||
|
||||
## Component format
|
||||
|
||||
To setup MQTT binding create a component of type `bindings.mqtt`. See [this guide]({{< ref "howto-bindings.md#1-create-a-binding" >}}) on how to create and apply a binding configuration.
|
||||
To setup a MQTT3 binding create a component of type `bindings.mqtt3`. See [this guide]({{< ref "howto-bindings.md#1-create-a-binding" >}}) on how to create and apply a binding configuration.
|
||||
|
||||
```yaml
|
||||
apiVersion: dapr.io/v1alpha1
|
||||
|
@ -17,7 +18,7 @@ kind: Component
|
|||
metadata:
|
||||
name: <NAME>
|
||||
spec:
|
||||
type: bindings.mqtt
|
||||
type: bindings.mqtt3
|
||||
version: v1
|
||||
metadata:
|
||||
- name: url
|
||||
|
@ -63,7 +64,7 @@ kind: Component
|
|||
metadata:
|
||||
name: mqtt-binding
|
||||
spec:
|
||||
type: bindings.mqtt
|
||||
type: bindings.mqtt3
|
||||
version: v1
|
||||
metadata:
|
||||
- name: url
|
||||
|
@ -103,7 +104,7 @@ metadata:
|
|||
name: mqtt-binding
|
||||
namespace: default
|
||||
spec:
|
||||
type: bindings.mqtt
|
||||
type: bindings.mqtt3
|
||||
version: v1
|
||||
metadata:
|
||||
- name: consumerID
|
|
@ -68,6 +68,10 @@ spec:
|
|||
value: explicit
|
||||
- name: deliverPolicy
|
||||
value: all
|
||||
- name: domain
|
||||
value: hub
|
||||
- name: apiPrefix
|
||||
value: PREFIX
|
||||
```
|
||||
|
||||
## Spec metadata fields
|
||||
|
@ -97,6 +101,8 @@ spec:
|
|||
| hearbeat | N | [Hearbeat] | `10s` |
|
||||
| ackPolicy | N | [Ack Policy] | `explicit` |
|
||||
| deliverPolicy | N | One of: all, last, new, sequence, time | `all` |
|
||||
| domain | N | [JetStream Leafondes] | `HUB` |
|
||||
| apiPrefix | N | [JetStream Leafnodes] | `PREFIX` |
|
||||
|
||||
## Create a NATS server
|
||||
|
||||
|
@ -162,5 +168,6 @@ nats -s localhost:4222 stream add myStream --subjects mySubject
|
|||
[Rate Limit]: https://docs.nats.io/jetstream/concepts/consumers#ratelimit
|
||||
[Hearbeat]: https://docs.nats.io/jetstream/concepts/consumers#hearbeat
|
||||
[Ack Policy]: https://docs.nats.io/nats-concepts/jetstream/consumers#ackpolicy
|
||||
[JetStream Leafonodes]: https://docs.nats.io/running-a-nats-service/configuration/leafnodes/jetstream_leafnodes
|
||||
[Decentralized JWT Authentication/Authorization]: https://docs.nats.io/running-a-nats-service/configuration/securing_nats/auth_intro/jwt
|
||||
[NATS token based authentication]: https://docs.nats.io/running-a-nats-service/configuration/securing_nats/auth_intro/tokens
|
||||
|
|
|
@ -1,15 +1,16 @@
|
|||
---
|
||||
type: docs
|
||||
title: "MQTT"
|
||||
linkTitle: "MQTT"
|
||||
description: "Detailed documentation on the MQTT pubsub component"
|
||||
title: "MQTT3"
|
||||
linkTitle: "MQTT3"
|
||||
description: "Detailed documentation on the MQTT3 pubsub component"
|
||||
aliases:
|
||||
- "/operations/components/setup-pubsub/supported-pubsub/setup-mqtt3/"
|
||||
- "/operations/components/setup-pubsub/supported-pubsub/setup-mqtt/"
|
||||
---
|
||||
|
||||
## Component format
|
||||
|
||||
To setup MQTT pubsub create a component of type `pubsub.mqtt`. See [this guide]({{< ref "howto-publish-subscribe.md#step-1-setup-the-pubsub-component" >}}) on how to create and apply a pubsub configuration
|
||||
To setup a MQTT3 pubsub create a component of type `pubsub.mqtt3`. See [this guide]({{< ref "howto-publish-subscribe.md#step-1-setup-the-pubsub-component" >}}) on how to create and apply a pubsub configuration
|
||||
|
||||
```yaml
|
||||
apiVersion: dapr.io/v1alpha1
|
||||
|
@ -17,7 +18,7 @@ kind: Component
|
|||
metadata:
|
||||
name: mqtt-pubsub
|
||||
spec:
|
||||
type: pubsub.mqtt
|
||||
type: pubsub.mqtt3
|
||||
version: v1
|
||||
metadata:
|
||||
- name: url
|
||||
|
@ -59,7 +60,7 @@ kind: Component
|
|||
metadata:
|
||||
name: mqtt-pubsub
|
||||
spec:
|
||||
type: pubsub.mqtt
|
||||
type: pubsub.mqtt3
|
||||
version: v1
|
||||
metadata:
|
||||
- name: url
|
||||
|
@ -96,7 +97,7 @@ kind: Component
|
|||
metadata:
|
||||
name: mqtt-pubsub
|
||||
spec:
|
||||
type: pubsub.mqtt
|
||||
type: pubsub.mqtt3
|
||||
version: v1
|
||||
metadata:
|
||||
- name: consumerID
|
||||
|
@ -119,7 +120,7 @@ The above example uses secrets as plain strings. It is recommended to use a secr
|
|||
|
||||
Note that in the case, the value of the consumer ID is random every time Dapr restarts, so we are setting `cleanSession` to true as well.
|
||||
|
||||
## Create a MQTT broker
|
||||
## Create a MQTT3 broker
|
||||
|
||||
{{< tabs "Self-Hosted" "Kubernetes">}}
|
||||
|
||||
|
@ -134,7 +135,7 @@ You can then interact with the server using the client port: `mqtt://localhost:1
|
|||
{{% /codetab %}}
|
||||
|
||||
{{% codetab %}}
|
||||
You can run a MQTT broker in kubernetes using following yaml:
|
||||
You can run a MQTT3 broker in kubernetes using following yaml:
|
||||
|
||||
```yaml
|
||||
apiVersion: apps/v1
|
|
@ -0,0 +1,113 @@
|
|||
---
|
||||
type: docs
|
||||
title: "Solace-AMQP"
|
||||
linkTitle: "Solace-AMQP"
|
||||
description: "Detailed documentation on the Solace-AMQP pubsub component"
|
||||
aliases:
|
||||
- "/operations/components/setup-pubsub/supported-pubsub/setup-solace-amqp/"
|
||||
---
|
||||
|
||||
## Component format
|
||||
|
||||
To setup Solace-AMQP pub/sub, create a component of type `pubsub.solace.amqp`. See [this guide]({{< ref "howto-publish-subscribe.md#step-1-setup-the-pubsub-component" >}}) on how to create and apply a pub/sub configuration.
|
||||
|
||||
```yaml
|
||||
apiVersion: dapr.io/v1alpha1
|
||||
kind: Component
|
||||
metadata:
|
||||
name: solace
|
||||
spec:
|
||||
type: pubsub.solace.amqp
|
||||
version: v1
|
||||
metadata:
|
||||
- name: url
|
||||
value: 'amqp://localhost:5672'
|
||||
- name: username
|
||||
value: 'default'
|
||||
- name: password
|
||||
value: 'default'
|
||||
```
|
||||
|
||||
{{% alert title="Warning" color="warning" %}}
|
||||
The above example uses secrets as plain strings. It is recommended to use a secret store for the secrets as described [here]({{< ref component-secrets.md >}}).
|
||||
{{% /alert %}}
|
||||
|
||||
## Spec metadata fields
|
||||
|
||||
| Field | Required | Details | Example |
|
||||
|--------------------|:--------:|---------|---------|
|
||||
| url | Y | Address of the AMQP broker. Can be `secretKeyRef` to use a secret reference. <br> Use the **`amqp://`** URI scheme for non-TLS communication. <br> Use the **`amqps://`** URI scheme for TLS communication. | `"amqp://host.domain[:port]"`
|
||||
| username | Y | The username to connect to the broker. Only required if anonymous is not specified or set to `false` .| `default`
|
||||
| password | Y | The password to connect to the broker. Only required if anonymous is not specified or set to `false`. | `default`
|
||||
| anonymous | N | To connect to the broker without credential validation. Only works if enabled on the broker. A username and password would not be required if this is set to `true`. | `true`
|
||||
| caCert | Required for using TLS | Certificate Authority (CA) certificate in PEM format for verifying server TLS certificates. | `"-----BEGIN CERTIFICATE-----\n<base64-encoded DER>\n-----END CERTIFICATE-----"`
|
||||
| clientCert | Required for using TLS | TLS client certificate in PEM format. Must be used with `clientKey`. | `"-----BEGIN CERTIFICATE-----\n<base64-encoded DER>\n-----END CERTIFICATE-----"`
|
||||
| clientKey | Required for using TLS | TLS client key in PEM format. Must be used with `clientCert`. Can be `secretKeyRef` to use a secret reference. | `"-----BEGIN RSA PRIVATE KEY-----\n<base64-encoded PKCS8>\n-----END RSA PRIVATE KEY-----"`
|
||||
|
||||
### Communication using TLS
|
||||
|
||||
To configure communication using TLS:
|
||||
|
||||
1. Ensure that the Solace broker is configured to support certificates.
|
||||
1. Provide the `caCert`, `clientCert`, and `clientKey` metadata in the component configuration.
|
||||
|
||||
For example:
|
||||
|
||||
```yaml
|
||||
apiVersion: dapr.io/v1alpha1
|
||||
kind: Component
|
||||
metadata:
|
||||
name: solace
|
||||
spec:
|
||||
type: pubsub.solace.amqp
|
||||
version: v1
|
||||
metadata:
|
||||
- name: url
|
||||
value: "amqps://host.domain[:port]"
|
||||
- name: username
|
||||
value: 'default'
|
||||
- name: password
|
||||
value: 'default'
|
||||
- name: caCert
|
||||
value: ${{ myLoadedCACert }}
|
||||
- name: clientCert
|
||||
value: ${{ myLoadedClientCert }}
|
||||
- name: clientKey
|
||||
secretKeyRef:
|
||||
name: mySolaceClientKey
|
||||
key: mySolaceClientKey
|
||||
auth:
|
||||
secretStore: <SECRET_STORE_NAME>
|
||||
```
|
||||
|
||||
> While the `caCert` and `clientCert` values may not be secrets, they can be referenced from a Dapr secret store as well for convenience.
|
||||
|
||||
### Publishing/subscribing to topics and queues
|
||||
|
||||
By default, messages are published and subscribed over topics. If you would like your destination to be a queue, prefix the topic with `queue:` and the Solace AMQP component will connect to a queue.
|
||||
|
||||
## Create a Solace broker
|
||||
|
||||
{{< tabs "Self-Hosted" "SaaS">}}
|
||||
|
||||
{{% codetab %}}
|
||||
You can run a Solace broker [locally using Docker](https://hub.docker.com/r/solace/solace-pubsub-standard):
|
||||
|
||||
```bash
|
||||
docker run -d -p 8080:8080 -p 55554:55555 -p 8008:8008 -p 1883:1883 -p 8000:8000 -p 5672:5672 -p 9000:9000 -p 2222:2222 --shm-size=2g --env username_admin_globalaccesslevel=admin --env username_admin_password=admin --name=solace solace/solace-pubsub-standard
|
||||
```
|
||||
|
||||
You can then interact with the server using the client port: `mqtt://localhost:5672`
|
||||
{{% /codetab %}}
|
||||
|
||||
{{% codetab %}}
|
||||
You can also sign up for a free SaaS broker on [Solace Cloud](https://console.solace.cloud/login/new-account?product=event-streaming).
|
||||
{{% /codetab %}}
|
||||
|
||||
{{< /tabs >}}
|
||||
|
||||
## Related links
|
||||
|
||||
- [Basic schema for a Dapr component]({{< ref component-schema >}})
|
||||
- Read [this guide]({{< ref "howto-publish-subscribe.md#step-2-publish-a-topic" >}}) for instructions on configuring pub/sub components
|
||||
- [Pub/sub building block]({{< ref pubsub >}})
|
|
@ -133,7 +133,7 @@ kubectl apply -f azureblob.yaml
|
|||
|
||||
### Running locally
|
||||
|
||||
To run locally, create a `components` dir containing the YAML file and provide the path to the `dapr run` command with the flag `--components-path`.
|
||||
To run locally, create a `components` dir containing the YAML file and provide the path to the `dapr run` command with the flag `--resources-path`.
|
||||
|
||||
This state store creates a blob file in the container and puts raw state inside it.
|
||||
|
||||
|
|
|
@ -360,7 +360,7 @@ Memory Store does not support modules and cannot be used with query.
|
|||
|
||||
Next is to start a Dapr application. Refer to this [component configuration file](../../../../developing-applications/building-blocks/state-management/query-api-examples/components/redis/redis.yml), which contains query indexing schemas. Make sure to modify the `redisHost` to reflect the local forwarding port which `redislabs/rejson` uses.
|
||||
```bash
|
||||
dapr run --app-id demo --dapr-http-port 3500 --components-path query-api-examples/components/redis
|
||||
dapr run --app-id demo --dapr-http-port 3500 --resources-path query-api-examples/components/redis
|
||||
```
|
||||
|
||||
Now populate the state store with the employee dataset, so you can then query it later.
|
||||
|
|
|
@ -54,8 +54,8 @@
|
|||
features:
|
||||
input: false
|
||||
output: true
|
||||
- component: MQTT
|
||||
link: mqtt
|
||||
- component: MQTT3
|
||||
link: mqtt3
|
||||
state: Beta
|
||||
version: v1
|
||||
since: "1.7"
|
||||
|
|
|
@ -28,8 +28,8 @@
|
|||
state: Beta
|
||||
version: v1
|
||||
since: "1.7"
|
||||
- component: MQTT
|
||||
link: setup-mqtt
|
||||
- component: MQTT3
|
||||
link: setup-mqtt3
|
||||
state: Stable
|
||||
version: v1
|
||||
since: "1.7"
|
||||
|
@ -48,3 +48,8 @@
|
|||
state: Alpha
|
||||
version: v1
|
||||
since: "1.8"
|
||||
- component: Solace-AMQP
|
||||
link: setup-solace-amqp
|
||||
state: Alpha
|
||||
version: v1
|
||||
since: "1.10"
|
||||
|
|
Loading…
Reference in New Issue