Message Queue Consumer
The Message Queue Consumer allows your application to listen to the message queue and receive data from message queue middleware such as Kafka.
Manifest Definition
modules:
messageQueueConsumer:
- key: mq-queue-consumer
# Name of the queue for which this consumer will be invoked
queue: queue-name
# The source of the message, corresponding to the messageQueues below
messageQueue: bcc-kafka
# Optional, for transforming the message body data
messageTransformer:
tenant: $.tenant
data:
name: $.name
resolver:
function: consumer-function
method: event-listener
function:
- key: consumer-function
handler: consumer.handler
messageQueues:
- key: bcc-kafka
type: kafka
endpoint: gitee-kafka:9092
Parameter Explanation
- The
messageQueuesmodule defines the type and address of the message queue. It matches themessageQueueinmessageQueueConsumerthrough the key. messageTransformeris used to transform Kafka message data, and it needs to have tenant and data fields.- The
functioninresolverpoints to the corresponding Key in thefunctionmodule, and themethodinresolvercorresponds to the method defined in the execution function. Please refer toresolver.