Table of Contents

Class DaprPublish

Namespace
Virtufin.Api.Services
Assembly
Virtufin.Api.dll

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

string

ProtobufCloudEventContentType

Content type of a CloudEvent stored as protobuf (binary data).

public const string ProtobufCloudEventContentType = "application/cloudevents+protobuf"

Field Value

string

RawPayloadKey

The Dapr metadata key that turns off Dapr's own CloudEvent wrapping.

public const string RawPayloadKey = "rawPayload"

Field Value

string

RawPayloadValue

The value of RawPayloadKey.

public const string RawPayloadValue = "true"

Field Value

string

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

dapr DaprClient
pubsubName string
topic string
cloudEvent byte[]
contentType string
cancellationToken CancellationToken

Returns

Task

RawPayloadMetadata()

The raw-payload metadata, for publishing and subscribing alike.

public static Dictionary<string, string> RawPayloadMetadata()

Returns

Dictionary<string, string>