Add Azure Service Bus Topics How To (#245)

This commit is contained in:
Yaron Schneider 2019-11-11 14:57:04 -08:00 committed by GitHub
parent 875264ba36
commit f5e14e85e2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 52 additions and 0 deletions

View File

@ -44,3 +44,4 @@ kubectl apply -f pubsub.yaml
[Setup Redis Streams](./setup-redis.md)
[Setup NATS](./setup-nats.md)
[Setup Azure Service bus](./setup-azure-servicebus.md)

View File

@ -0,0 +1,51 @@
# Setup Azure Service Bus
Follow the instructions [here](https://docs.microsoft.com/en-us/azure/service-bus-messaging/service-bus-quickstart-topics-subscriptions-portal) on setting up Azure Service Bus Topics.
## Create a Dapr component
The next step is to create a Dapr component for Azure Service Bus.
Create the following YAML file named `azuresb.yaml`:
```
apiVersion: dapr.io/v1alpha1
kind: Component
metadata:
name: <name>
spec:
type: pubsub.azure.servicebus
metadata:
- name: connectionString
value: <REPLACE-WITH-CONNECTION-STRING> # Required.
- name: timeoutInSec
value: <REPLACE-WITH-TIMEOUT-IN-SEC> # Optional. Default: "60".
- name: disableEntityManagement
value: <REPLACE-WITH-DISABLE-ENTITY-MANAGEMENT> # Optional. Default: false. When set to true, topics and subscriptions do not get created automatically.
- name: maxDeliveryCount
value: <REPLACE-WITH-MAX-DELIVERY-COUNT> # Optional.
- name: lockDurationInSec
value: <REPLACE-WITH-LOCK-DURATION-IN-SEC> # Optional.
- name: defaultMessageTimeToLiveInSec
value: <REPLACE-WITH-MESSAGE-TIME-TO-LIVE-IN-SEC> # Optional.
- name: autoDeleteOnIdleInSec
value: <REPLACE-WITH-AUTO-DELETE-ON-IDLE-IN-SEC> # Optional.
```
The above example uses secrets as plain strings. It is recommended to use a secret store for the secrets as described [here](../../concepts/components/secrets.md)
## Apply the configuration
### In Kubernetes
To apply the Azure Service Bus pub/sub to Kubernetes, use the `kubectl` CLI:
```
kubectl apply -f azuresb.yaml
```
### Running locally
The Dapr CLI will automatically create a directory named `components` in your current working directory with a Redis component.
To use Azure Service Bus, replace the redis_messagebus.yaml file with azuresb.yaml above.