You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: daprdocs/content/en/developing-applications/building-blocks/pubsub/pubsub-raw.md
+86-5
Original file line number
Diff line number
Diff line change
@@ -20,14 +20,51 @@ Not using CloudEvents disables support for tracing, event deduplication per mess
20
20
21
21
To disable CloudEvent wrapping, set the `rawPayload` metadata to `true` as part of the publishing request. This allows subscribers to receive these messages without having to parse the CloudEvent schema.
@@ -74,9 +111,52 @@ Dapr apps are also able to subscribe to raw events coming from existing pub/sub
74
111
75
112
### Programmatically subscribe to raw events
76
113
77
-
When subscribing programmatically, add the additional metadata entry for `rawPayload` so the Dapr sidecar automatically wraps the payloads into a CloudEvent that is compatible with current Dapr SDKs.
114
+
When subscribing programmatically, add the additional metadata entry for `rawPayload` to allow the subscriber to receive a message that is not wrapped by a CloudEvent. For .NET, this metadata entry is called `isRawPayload`.
In the Program.cs file for the `checkout` service, you'll notice there's no need to rewrite your app code to use Dapr's service invocation. You can enable service invocation by simply adding the `dapr-app-id` header, which specifies the ID of the target service.
var response = await client.PostAsync($"{baseURL}/orders", content);
448
-
Console.WriteLine("Order passed: " + order);
445
+
var response = await client.PostAsJsonAsync("/orders", order, cts.Token);
446
+
Console.WriteLine("Order passed: " + order);
449
447
```
450
448
451
449
{{% /codetab %}}
@@ -1089,13 +1087,11 @@ dapr run --app-id checkout --app-protocol http --dapr-http-port 3500 -- dotnet r
1089
1087
In the Program.cs file for the `checkout` service, you'll notice there's no need to rewrite your app code to use Dapr's service invocation. You can enable service invocation by simply adding the `dapr-app-id` header, which specifies the ID of the target service.
0 commit comments