forked from dapr/quickstarts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Commands
63 lines (43 loc) · 2.46 KB
/
Commands
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
The default pubsub.yaml($HOME/.dapr/components) file is used. And rabbit mq is used for pub sub implementation. Below are the contents of pubsub.yaml file.
The other way to include pubsub.yaml is to create a components directory and create a file called pubsub.yaml and add the below contents to the file.
And then modify the dapr run command to include components directory path using "--resources-path".
apiVersion: dapr.io/v1alpha1
kind: Component
metadata:
name: orderpubsub
spec:
type: pubsub.rabbitmq
version: v1
metadata:
- name: host
value: "amqp://localhost:5672"
- name: durable
value: "false"
- name: deletedWhenUnused
value: "false"
- name: autoAck
value: "false"
- name: reconnectWait
value: "0"
- name: concurrency
value: parallel
scopes:
- orderprocessing
- checkout
Start a RabbitMQ message broker by entering the following command:
docker run -d -p 5672:5672 -p 15672:15672 --name dtc-rabbitmq rabbitmq:3-management-alpine
Java:
dapr run --app-id orderprocessing --app-port 6001 --dapr-http-port 3601 --dapr-grpc-port 60001 --resources-path ../../components mvn spring-boot:run
dapr run --app-id checkout --app-port 6002 --dapr-http-port 3602 --dapr-grpc-port 60002 --resources-path ../../components mvn spring-boot:run
Python:
dapr run --app-id orderprocessing --app-port 6001 --dapr-grpc-port 3601 --app-protocol grpc --resources-path ../components python3 OrderProcessingService.py
dapr run --app-id checkout --app-port 6002 --dapr-grpc-port 3602 --app-protocol grpc --resources-path ../components python3 CheckoutService.py
GO:
dapr run --app-id orderprocessing --app-port 6001 --dapr-http-port 3601 --dapr-grpc-port 60001 --resources-path ../../components go run OrderProcessingService.go
dapr run --app-id checkout --app-port 6002 --dapr-http-port 3602 --dapr-grpc-port 60002 --resources-path ../../components go run CheckoutService.go
CSharp:
dapr run --app-id orderprocessing --app-port 6001 --dapr-http-port 3601 --dapr-grpc-port 60001 --app-ssl --resources-path ../../components dotnet run
dapr run --app-id checkout --app-port 6002 --dapr-http-port 3602 --dapr-grpc-port 60002 --app-ssl --resources-path ../../components dotnet run
Javascript:
dapr run --app-id orderprocessing --app-port 6001 --dapr-http-port 3601 --dapr-grpc-port 60001 --resources-path ../../components npm start
dapr run --app-id checkout --app-port 6002 --dapr-http-port 3602 --dapr-grpc-port 60002 --resources-path ../../components npm start