File tree 1 file changed +9
-5
lines changed
examples/bidipubsub/bidisub
1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -29,16 +29,18 @@ func main() {
29
29
if err != nil {
30
30
log .Fatal (err )
31
31
}
32
- fmt .Printf (">>Created client\n " )
32
+
33
+ var deadLetterTopic = "deadletter"
33
34
34
35
// Streaming subscription for topic "sendorder" on pubsub component
35
36
// "messages". The given subscription handler is called when a message is
36
37
// received. The returned `stop` function is used to stop the subscription
37
38
// and close the connection.
38
39
stop , err := client .SubscribeWithHandler (context .Background (),
39
40
daprd.SubscriptionOptions {
40
- PubsubName : "messages" ,
41
- Topic : "sendorder" ,
41
+ PubsubName : "messages" ,
42
+ Topic : "sendorder" ,
43
+ DeadLetterTopic : & deadLetterTopic ,
42
44
},
43
45
eventHandler ,
44
46
)
@@ -49,9 +51,11 @@ func main() {
49
51
// Another method of streaming subscriptions, this time for the topic "neworder".
50
52
// The returned `sub` object is used to receive messages.
51
53
// `sub` must be closed once it's no longer needed.
54
+
52
55
sub , err := client .Subscribe (context .Background (), daprd.SubscriptionOptions {
53
- PubsubName : "messages" ,
54
- Topic : "neworder" ,
56
+ PubsubName : "pubsub" ,
57
+ Topic : "neworder" ,
58
+ DeadLetterTopic : & deadLetterTopic ,
55
59
})
56
60
if err != nil {
57
61
log .Fatal (err )
You can’t perform that action at this time.
0 commit comments