Message Queue Payload - C Sharp
The logic payload type when a task is invoked by a Message Queue (MQ) trigger.
Class Reference
Type
MessagePayload(type ofPayload.Message)
Properties
| Property | Type | Description | 
|---|---|---|
ClientIdentityContext | IdentityContext | MQ client ID and name | 
Subscriber | Subscriber | MQ subscriber | 
Data | byte[] | MQ data (empty array if none) | 
IdentityContext
Refer to: IdentityContext
Subscriber
| Property | Type | Description | 
|---|---|---|
Kafka | KafkaSubscriber | Apache Kafka | 
KafkaSubscriber
| Property | Type | Description | 
|---|---|---|
Brokers | List<string> | Broker names in the Kafka cluster | 
GroupId | string | MQ group ID | 
topic | Topic | MQ topic | 
Partition | int | MQ partition | 
Offset | long | MQ 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
datato a JSON object.