项目作者: oystparis

项目描述 :
Kafka Connect NATS connector
高级语言: Java
项目地址: git://github.com/oystparis/kafka-connect-nats.git
创建时间: 2017-05-19T10:20:39Z
项目社区:https://github.com/oystparis/kafka-connect-nats

开源协议:Apache License 2.0

下载


kafka-connect-nats

Kafka Connect NATS connector is used to load data from NATS to KAFKA.

Building

You can build the connector with Maven using the standard lifecycle phases:

  1. mvn clean
  2. mvn package

Source Connector

Sample Configuration

  1. name=nats_source
  2. connector.class=com.oyst.kafka.connect.nats.NatsSourceConnector
  3. tasks.max=1
  4. topic=NATS-TOPIC
  5. nats.subject=NATS-SUBJECT
  6. nats.url=nats://localhost:4222
  7. nats.queue.group=nats-queue

Since the 0.2 version, kafka-connect-nats manage the nats clustering, for example:

  1. nats.url=nats://localhost:4222,localhost:4223
  • name: Name of the connector
  • connector.class: Class of the implementation of the connector
  • tasks.max: Maximum number of tasks to create
  • topic: The destination Kafka’s Topic Name
  • nats.subject: The name of NATS Subject
  • nats.url: URI of NATS server(s)
  • nats.queue.group: Name of NATS Queue Group

Sink Connector

Each Key of Kafka’s message as considered as a NATS subject and each value as NATS message.

Sample Configuration

  1. name=nats_sink
  2. connector.class=com.oyst.kafka.connect.nats.NatsSinkConnector
  3. tasks.max=1
  4. topics=KAFKA-TOPIC
  5. nats.url=nats://localhost:4222
  6. nats.subject=FROM-KAFKA
  • name: Name of the connector
  • connector.class: Class of the implementation of the connector
  • tasks.max: Maximum number of tasks to create
  • topic: The Kafka’s Topic to Consume
  • nats.url: URI of NATS server(s)
  • nats.subject: The name of NATS Subject