mirror of https://github.com/dapr/quickstarts.git
Added components folder
This commit is contained in:
parent
8c88f1f668
commit
fc8f039ced
|
|
@ -0,0 +1,21 @@
|
||||||
|
apiVersion: dapr.io/v1alpha1
|
||||||
|
kind: Component
|
||||||
|
metadata:
|
||||||
|
name: checkout
|
||||||
|
spec:
|
||||||
|
type: bindings.kafka
|
||||||
|
version: v1
|
||||||
|
metadata:
|
||||||
|
# Kafka broker connection setting
|
||||||
|
- name: brokers
|
||||||
|
value: localhost:9092
|
||||||
|
# consumer configuration: topic and consumer group
|
||||||
|
- name: topics
|
||||||
|
value: sample
|
||||||
|
- name: consumerGroup
|
||||||
|
value: group1
|
||||||
|
# publisher configuration: topic
|
||||||
|
- name: publishTopic
|
||||||
|
value: sample
|
||||||
|
- name: authRequired
|
||||||
|
value: "false"
|
||||||
|
|
@ -0,0 +1,23 @@
|
||||||
|
apiVersion: dapr.io/v1alpha1
|
||||||
|
kind: Component
|
||||||
|
metadata:
|
||||||
|
name: order_pub_sub
|
||||||
|
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
|
||||||
|
|
@ -3,6 +3,7 @@ package main
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"log"
|
"log"
|
||||||
|
|
||||||
dapr "github.com/dapr/go-sdk/client"
|
dapr "github.com/dapr/go-sdk/client"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -14,24 +15,15 @@ func main() {
|
||||||
}
|
}
|
||||||
defer client.Close()
|
defer client.Close()
|
||||||
ctx := context.Background()
|
ctx := context.Background()
|
||||||
|
|
||||||
secret, err := client.GetSecret(ctx, SECRET_STORE_NAME, "secret", nil)
|
secret, err := client.GetSecret(ctx, SECRET_STORE_NAME, "secret", nil)
|
||||||
if err != nil {
|
|
||||||
return nil, errors.Wrap(err, "Got error for accessing key")
|
|
||||||
}
|
|
||||||
|
|
||||||
if secret != nil {
|
if secret != nil {
|
||||||
log.Println("Result : ")
|
log.Println("Result : ")
|
||||||
log.Println(secret)
|
log.Println(secret)
|
||||||
}
|
}
|
||||||
|
secretBulk, err := client.GetBulkSecret(ctx, SECRET_STORE_NAME, nil)
|
||||||
secretRandom, err := client.GetBulkSecret(ctx, SECRET_STORE_NAME, nil)
|
|
||||||
if err != nil {
|
|
||||||
return nil, errors.Wrap(err, "Got error for accessing key")
|
|
||||||
}
|
|
||||||
|
|
||||||
if secret != nil {
|
if secret != nil {
|
||||||
log.Println("Result for bulk: ")
|
log.Println("Result for bulk: ")
|
||||||
log.Println(secretRandom)
|
log.Println(secretBulk)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue