Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 4638f8f

Browse files
alicejgibbonsmsfussell
andauthoredMay 24, 2025··
Update PubSub Raw doc (#4659)
* Update pubsub-raw.md Updating Raw PubSub doc to be more specific about content type and delivery details. Signed-off-by: Alice Gibbons <[email protected]> * Update daprdocs/content/en/developing-applications/building-blocks/pubsub/pubsub-raw.md Signed-off-by: Mark Fussell <[email protected]> --------- Signed-off-by: Alice Gibbons <[email protected]> Signed-off-by: Mark Fussell <[email protected]> Co-authored-by: Mark Fussell <[email protected]>
1 parent 46d200e commit 4638f8f

File tree

1 file changed

+6
-4
lines changed
  • daprdocs/content/en/developing-applications/building-blocks/pubsub

1 file changed

+6
-4
lines changed
 

‎daprdocs/content/en/developing-applications/building-blocks/pubsub/pubsub-raw.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ weight: 2200
66
description: "Learn when you might not use CloudEvents and how to disable them."
77
---
88

9-
When adding Dapr to your application, some services may still need to communicate via pub/sub messages not encapsulated in CloudEvents, due to either compatibility reasons or some apps not using Dapr. These are referred to as "raw" pub/sub messages. Dapr enables apps to [publish and subscribe to raw events]({{< ref "pubsub-cloudevents.md#publishing-raw-messages" >}}) not wrapped in a CloudEvent for compatibility.
9+
When adding Dapr to your application, some services may still need to communicate via pub/sub messages not encapsulated in CloudEvents, due to either compatibility reasons or some apps not using Dapr. These are referred to as "raw" pub/sub messages. Dapr enables apps to [publish and subscribe to raw events]({{< ref "pubsub-cloudevents.md#publishing-raw-messages" >}}) not wrapped in a CloudEvent for compatibility and to send data that is not JSON serializable.
1010

1111
## Publishing raw messages
1212

@@ -105,13 +105,15 @@ $app->run(function(\DI\FactoryInterface $factory) {
105105

106106
## Subscribing to raw messages
107107

108-
Dapr apps are also able to subscribe to raw events coming from existing pub/sub topics that do not use CloudEvent encapsulation.
108+
Dapr apps can subscribe to raw messages from pub/sub topics, even if they weren’t published as CloudEvents. However, the subscribing Dapr process still wraps these raw messages in a CloudEvent before delivering them to the subscribing application.
109109

110110
<img src="/images/pubsub_subscribe_raw.png" alt="Diagram showing how to subscribe with Dapr when publisher does not use Dapr or CloudEvent" width=1000>
111111

112112
### Programmatically subscribe to raw events
113113

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`.
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`.
115+
116+
When using raw payloads the message is always base64 encoded with content type `application/octet-stream`.
115117

116118
{{< tabs ".NET" "Python" "PHP" >}}
117119

@@ -242,4 +244,4 @@ scopes:
242244
- Learn more about [publishing and subscribing messages]({{< ref pubsub-overview.md >}})
243245
- List of [pub/sub components]({{< ref supported-pubsub >}})
244246
- Read the [API reference]({{< ref pubsub_api.md >}})
245-
- Read the .NET sample on how to [consume Kafka messages without CloudEvents](https://github.com/dapr/samples/pubsub-raw-payload)
247+
- Read the .NET sample on how to [consume Kafka messages without CloudEvents](https://github.com/dapr/samples/pubsub-raw-payload)

0 commit comments

Comments
 (0)
Please sign in to comment.