RocketMQ connector


RocketMQ connector

Parent document: Connectors

BitSail RocketMQ connector supports writing in batch mode.

Maven dependency

<dependency>
   <groupId>com.bytedance.bitsail</groupId>
   <artifactId>bitsail-connector-rocketmq</artifactId>
   <version>${revision}</version>
</dependency>

RocketMQ writer

Supported data types

  • int, bigint
  • float, double, decimal
  • timestamp, date
  • string, char
  • boolean
  • binary

Parameters

The following mentioned parameters should be added to job.writer block when using, for example:

{
  "job": {
    "writer": {
      "class": "com.bytedance.bitsail.connector.legacy.rocketmq.sink.RocketMQOutputFormat",
      "name_server_address": "127.0.0.1:9876",
      "producer_group": "test_producer_group",
      "topic": "test_topic"
    }
  }
}

Necessary parameters

Param nameRequiredOptional valueDescription
classYesClass name of RocketMQ writer, com.bytedance.bitsail.connector.legacy.rocketmq.sink.RocketMQOutputFormat
name_server_addressYesName server address of rocketmq
topicYesTopic to write
columnsYesDescribing fields' names and types

Optional parameters

Param nameRequiredOptional valueDescription
writer_parallelism_numNoWriter parallelism num
producer_groupNoProducer group for the task. If not defined, it will use a random string
tagNoTags of the produced messages
enable_batch_flushNotrue: send a batch of messages at once;
false: send single message at once.
Default true.
batch_sizeNoThe number of messages to send in a batch. Default 100
log_failures_onlyNoWhen send failure happens, it will:
true: only log this failure,
false: throw exception.
Default false.
enable_sync_sendNoIf use sync send. Default false.
access_keyNoAccess key for authorization.
secret_keyNoSecret key for authorization.
send_failure_retry_timesNoMax retry times for a send failure, default 3
send_message_timeout_msNoTimeout for sending a message, default 3000 ms
max_message_size_bytesNoMax message size, default 4194304 bytes
keyNoSpecify which field(s) is used as the message key.
partition_fieldsNoSpecify which field(s) is used to select queue.

Configuration examples: RocketMQ connector example