Skip to main content

Message Queue Payload - JS/TS

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

Class Reference

Type

  • { messageQueue: MessagePayload } (one of the Payload type)

Sub Class Reference

MessagePayload

Importable from @fstnetwork/loc-logic-sdk

PropertyTypeDescription
clientIdentityContextIdentityContextFor_UuidMQ client ID and name
subscriberSubscriberMQ subscriber
datanumber[]MQ data (empty array if none)

IdentityContextFor_Uuid

Refer to: IdentityContextFor_Uuid

Subscriber

MQ TypeSubscriber TypeReference
Apache Kafka{ kafka: KafkaSubscriber }KafkaSubscriber

KafkaSubscriber

PropertyTypeDescription
brokersstring[]Broker names in the Kafka cluster
groupIdstringMQ group ID
topicstringMQ topic
partitionnumberMQ partition
offsetnumberMQ offset

Examples

const payload = await ctx.payload();

const data = payload.messageQueue?.data;

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