https://github.com/ajsalemo/dapr-pub-sub-examples
Various examples of using Dapr with the pubsub building block across runtimes.
https://github.com/ajsalemo/dapr-pub-sub-examples
Last synced: 7 months ago
JSON representation
Various examples of using Dapr with the pubsub building block across runtimes.
- Host: GitHub
- URL: https://github.com/ajsalemo/dapr-pub-sub-examples
- Owner: Ajsalemo
- Created: 2023-07-24T23:03:03.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2024-11-05T15:27:38.000Z (over 1 year ago)
- Last Synced: 2024-12-29T10:16:06.633Z (over 1 year ago)
- Language: PHP
- Size: 3.31 MB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# dapr-pub-sub-examples
Various examples of using Dapr with the pubsub building block across runtimes.
**NOTE**: These example(s) and the below instructions use Event Hub - however, other pubsub providers can be input as desired.
## Running locally
1. Install some type of Kubernetes cluster. An easy method is to just enable [Kubernetes in Docker Desktop](https://docs.docker.com/desktop/kubernetes/#:~:text=To%20turn%20on%20Kubernetes%20in%20Docker%20Desktop%3A%201,and%20installs%20the%20%2Fusr%2Flocal%2Fbin%2Fkubectl%20command%20on%20your%20machine.)
2. Each language folder has a `local-k8s` sub folder. This contains a `pubsub.yaml`, `deployment.yaml` and `service.yaml` file.
- Prior to deployment, update the `pubsub.yaml` with the required values needed
3. Build the image with the `Dockerfile` in the language folder being used. If the image name is not the same name in `deployment.yaml`, then update `deployment.yaml`
4. Deploy the project with `kubectl apply -f local-k8s/`
## Using Container Apps
1. Create a Container App and Container App environment
2. Push the image built from the language `Dockerfile` to an Azure Container Registry
3. Create a `pubsub` dapr component, with the following:
- 
- Add in the same `metaData` thats in the `local-k8s` folders in the examples
- `connectionString`: EventHub connection string
- `storageAccountName`: Storage account name
- `storageAccountKey`: Storage account key
- `storageContainerName`: Storage ontainer name
- `consumerID`: Name of the consumer ID, if not defined, it uses the `appId`
- Add the component to the application by specifying it in `scopes`
4. Enable dapr on the Container App
5. Ensure ingress is set to the appropriate port for the language example being used