Class DaprPublish
How the gateway puts a CloudEvent on a Dapr topic: as a raw payload, so the stream holds the CloudEvent bytes exactly as given (JSON, or protobuf for binary data) and subscriptions read them back verbatim.
public static class DaprPublish
- Inheritance
-
DaprPublish
- Inherited Members
Fields
JsonCloudEventContentType
Content type of a CloudEvent stored as JSON.
public const string JsonCloudEventContentType = "application/cloudevents+json"
Field Value
ProtobufCloudEventContentType
Content type of a CloudEvent stored as protobuf (binary data).
public const string ProtobufCloudEventContentType = "application/cloudevents+protobuf"
Field Value
RawPayloadKey
The Dapr metadata key that turns off Dapr's own CloudEvent wrapping.
public const string RawPayloadKey = "rawPayload"
Field Value
RawPayloadValue
The value of RawPayloadKey.
public const string RawPayloadValue = "true"
Field Value
Methods
PublishCloudEventAsync(DaprClient, string, string, byte[], string, CancellationToken)
Publishes an encoded CloudEvent as a raw payload.
public static Task PublishCloudEventAsync(this DaprClient dapr, string pubsubName, string topic, byte[] cloudEvent, string contentType, CancellationToken cancellationToken = default)
Parameters
daprDaprClientpubsubNamestringtopicstringcloudEventbyte[]contentTypestringcancellationTokenCancellationToken
Returns
RawPayloadMetadata()
The raw-payload metadata, for publishing and subscribing alike.
public static Dictionary<string, string> RawPayloadMetadata()