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 protobuf CloudEvent exactly as encoded (ToStreamBytes(CloudEvent)) and subscriptions read it back verbatim.

public static class DaprPublish
Inheritance
DaprPublish
Inherited Members

Fields

ProtobufCloudEventContentType

Content type of a stream entry: a CloudEvent as protobuf.

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[], CancellationToken)

Publishes a protobuf CloudEvent, encoded for the stream, as a raw payload.

public static Task PublishCloudEventAsync(this DaprClient dapr, string pubsubName, string topic, byte[] cloudEvent, CancellationToken cancellationToken = default)

Parameters

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

Returns

Task

RawPayloadMetadata()

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

public static Dictionary<string, string> RawPayloadMetadata()

Returns

Dictionary<string, string>