mirror of https://github.com/dapr/docs.git
Update pubsub-raw.md
Updating Raw PubSub doc to be more specific about content type and delivery details. Signed-off-by: Alice Gibbons <alice@diagrid.io>
This commit is contained in:
parent
3b9d89246e
commit
38f976e37a
|
|
@ -6,7 +6,7 @@ weight: 2200
|
||||||
description: "Learn when you might not use CloudEvents and how to disable them."
|
description: "Learn when you might not use CloudEvents and how to disable them."
|
||||||
---
|
---
|
||||||
|
|
||||||
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.
|
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.
|
||||||
|
|
||||||
## Publishing raw messages
|
## Publishing raw messages
|
||||||
|
|
||||||
|
|
@ -105,13 +105,13 @@ $app->run(function(\DI\FactoryInterface $factory) {
|
||||||
|
|
||||||
## Subscribing to raw messages
|
## Subscribing to raw messages
|
||||||
|
|
||||||
Dapr apps are also able to subscribe to raw events coming from existing pub/sub topics that do not use CloudEvent encapsulation.
|
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.
|
||||||
|
|
||||||
<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>
|
<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>
|
||||||
|
|
||||||
### Programmatically subscribe to raw events
|
### Programmatically subscribe to raw events
|
||||||
|
|
||||||
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`.
|
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`. When using raw payloads the message will always be base64 encoded with content type `application/octet-stream`.
|
||||||
|
|
||||||
{{< tabs ".NET" "Python" "PHP" >}}
|
{{< tabs ".NET" "Python" "PHP" >}}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue