DataProxy Plugin
Concepts and Models
DataProxy is a message flow architecture based on Apache Flume with its + Channel
+ Sink
components. Here we focus on the sink layer alone.
MessageQueueZoneSink
: The standard MQ sink provided by DataProxy, supposedly to support all kinds of MQ types.MessageQueueHandler
: The abstract MQ handler interface that deals with connecting, sending data to, and disconnecting the MQ cluster.EventHandler
: The interface to convert MQ message header and body when required. For example to convert the data protocol.
The concepts introduced above can be represented by the following figure:
Development Process
- Implement the subclass plugin of MessageQueueHandler, namely KafKaHandler and its init / start /stop / send methods.
- Implenent the EventHandler interface as ProtoBufferEventHandler and its parseHeader / parseBody method
@Override
INLONG_COMPRESSED_TYPE compressType) {
// retrieve, process and convert event header
@Override
public byte[] parseBody(IdTopicConfig idConfig, BatchPackProfile profile, INLONG_COMPRESSED_TYPE compressType)
throws IOException {
// retrieve and repack event to ProtoBuffer message
}
(See the full implementation org.apache.inlong.dataproxy.sink.mq.kafka.KafkaHandler from inlong-dataproxy module)