Skip to content

Data queue sink connector

The data queue sink connector reads messages from Kafka topics and writes them to an IBM i data queue. IBM i programs can then process the entries from the data queue.

Connector class com.infoviewsystems.kafka.connect.as400.core.AS400DataQueueSinkConnector
Type Sink
Typical use Deliver events from Kafka to IBM i applications through data queues

Configure the connection properties and the license together with the properties on this page.

Configuration properties

Configure the following data queue sink connector properties.

Sink section of the connector configuration form in Confluent Control Center

Parameter Description Mandatory Default value Configuration key
Data Queue Name of the data queue to write to. Required null as400.write.dataqueue.name
Library Library of the data queue to write to. Required null as400.write.dataqueue.library
Is Keyed DataQ Required for keyed data queues. Leave blank for non-keyed data queues. Used to read any message from the data queue. Optional false as400.write.dataqueue.key
Format File Name Treats the data queue entry as an externally defined data structure. When set, the connector dynamically retrieves the record format from the specified IBM i file and parses the received data queue entry into a map of field name / value pairs. The connector performs the type conversion and supports all types, such as packed and date / time. Optional null as400.sink.format.name
Format File Library Library of the format file. If you do not specify it, the connector locates the format file through the connection library list. Optional null as400.sink.file.library
DQ Entry Length Maximum data queue entry length. When specified and greater than 0, the value is truncated to fit the maximum length. Optional 0 as400.dq.entry.length
DQ Key Length Maximum data queue key length. When specified and greater than 0, this value is used instead of dynamically retrieving the key length from the data queue definition on the server. Optional null as400.dq.key.length

Samples

The following samples show the sink connector configuration for each converter, including a dead letter queue (DLQ).

Sample JSON for the data queue sink connector with JsonConverter
{
  "name": "AS400DataQueueSinkConnectorConnector_0",
  "config": {
    "connector.class": "com.infoviewsystems.kafka.connect.as400.core.AS400DataQueueSinkConnector",
    "key.converter": "org.apache.kafka.connect.storage.StringConverter",
    "value.converter": "org.apache.kafka.connect.json.JsonConverter",
    "topics": "Test",
    "transforms": "",
    "errors.tolerance": "all",
    "errors.deadletterqueue.topic.name": "json_dlq",
    "errors.deadletterqueue.topic.replication.factor": "1",
    "errors.deadletterqueue.context.headers.enable": "true",
    "as400.url": "your-ibm-i-host",
    "as400.userId": "your-username",
    "as400.password": "your-password",
    "as400.secure.connection": "false",
    "as400.license.protocol": "FILE",
    "as400.license.path": "license-file-path",
    "license.fileName": "as400-license.lic",
    "as400.write.dataqueue.name": "your-data-queue-name",
    "as400.write.dataqueue.library": "your-library",
    "as400.sink.format.name": "format-file-name",
    "as400.sink.file.library": "format-file-library",
    "value.converter.schemas.enable": "false"

    /*Below are optional (Required if security enabled) */
    // "security.protocol": "SASL_SSL",
    // "sasl.mechanism": "PLAIN/SCRAM",
    // "sasl.jaas.config": "org.apache.kafka.common.security.plain.PlainLoginModule required username=\"<api-key>\" password=\"<api-secret>\";"
  }
}
Sample JSON for the data queue sink connector with JsonSchemaConverter and Schema Registry
{
  "name": "AS400DataQueueSinkConnectorConnector_0",
  "config": {
    "connector.class": "com.infoviewsystems.kafka.connect.as400.core.AS400DataQueueSinkConnector",
    "key.converter": "org.apache.kafka.connect.storage.StringConverter",
    "value.converter": "io.confluent.connect.json.JsonSchemaConverter",
    "topics": "Test",
    "transforms": "",
    "errors.tolerance": "all",
    "errors.deadletterqueue.topic.name": "jsonSchema-CDCDQ8_dlq",
    "errors.deadletterqueue.topic.replication.factor": "1",
    "errors.deadletterqueue.context.headers.enable": "true",
    "as400.url": "your-ibm-i-host",
    "as400.userId": "your-username",
    "as400.password": "your-password",
    "as400.secure.connection": "false",
    "as400.license.protocol": "FILE",
    "as400.license.path": "license-file-path",
    "license.fileName": "as400-license.lic",
    "as400.write.dataqueue.name": "your-data-queue-name",
    "as400.write.dataqueue.library": "your-library",
    "as400.sink.format.name": "format-file-name",
    "as400.sink.file.library": "format-file-library",
    "value.converter.schema.registry.url": "http://localhost:8081"

    /*Below are optional (Required if security enabled) */
    // "security.protocol": "SASL_SSL",
    // "sasl.mechanism": "PLAIN/SCRAM",
    // "sasl.jaas.config": "org.apache.kafka.common.security.plain.PlainLoginModule required username=\"<api-key>\" password=\"<api-secret>\";"
  }
}
Sample JSON for the data queue sink connector with AvroConverter and Schema Registry
{
  "name": "AS400DataQueueSinkConnectorConnector_0",
  "config": {
    "connector.class": "com.infoviewsystems.kafka.connect.as400.core.AS400DataQueueSinkConnector",
    "key.converter": "org.apache.kafka.connect.storage.StringConverter",
    "value.converter": "io.confluent.connect.avro.AvroConverter",
    "topics": "Test",
    "transforms": "",
    "errors.tolerance": "all",
    "errors.deadletterqueue.topic.name": "avro_dlq",
    "errors.deadletterqueue.topic.replication.factor": "1",
    "errors.deadletterqueue.context.headers.enable": "true",
    "as400.url": "your-ibm-i-host",
    "as400.userId": "your-username",
    "as400.password": "your-password",
    "as400.secure.connection": "false",
    "as400.license.protocol": "FILE",
    "as400.license.path": "license-file-path",
    "license.fileName": "as400-license.lic",
    "as400.write.dataqueue.name": "your-data-queue-name",
    "as400.write.dataqueue.library": "your-library",
    "as400.sink.format.name": "format-file-name",
    "as400.sink.file.library": "format-file-library",
    "value.converter.schema.registry.url": "http://localhost:8081"

    /*Below are optional (Required if security enabled) */
    // "security.protocol": "SASL_SSL",
    // "sasl.mechanism": "PLAIN/SCRAM",
    // "sasl.jaas.config": "org.apache.kafka.common.security.plain.PlainLoginModule required username=\"<api-key>\" password=\"<api-secret>\";"
  }
}

Writing to a keyed data queue

To write a response to a keyed data queue, you typically set the as400.write.dataqueue.key property to true. The property tells the connector to write the response data to a keyed data queue. Add it to any of the samples above:

"as400.write.dataqueue.key": "true",