Skip to main content

Message Queue Payload - C Sharp

The logic payload type when a task is invoked by a Message Queue (MQ) trigger.

Class Reference

Type

Properties

PropertyTypeDescription
ClientIdentityContextIdentityContextMQ client ID and name
SubscriberSubscriberMQ subscriber
Databyte[]MQ data (empty array if none)

IdentityContext

Refer to: IdentityContext

Subscriber

PropertyTypeDescription
KafkaKafkaSubscriberApache Kafka

KafkaSubscriber

PropertyTypeDescription
BrokersList<string>Broker names in the Kafka cluster
GroupIdstringMQ group ID
topicTopicMQ topic
PartitionintMQ partition
OffsetlongMQ offset

Examples

Import namespace(s)
using System.Text;
using System.Text.Json.Nodes;
var payload = await ctx.GetPayload();

byte[]? data = payload.MessagePayload?.Data;

See the example of Payload for checking the payload type.

See the example of HTTP Payload for parsing data to a JSON object.