kafka handler

1.配置kafka 参数文件
在ogg主目录下有示例文件:
  1. [root@WH0PRDBRP00AP0013 ogg]# cd AdapterExamples/big-data/kafka/
  2. [root@WH0PRDBRP00AP0013 kafka]# ls
  3. custom_kafka_producer.properties kafka.props rkafka.prm
custom_kafka_producer.properties :
  1. bootstrap.servers=localhost:9092 //kafka服务器的地址
  2. acks=1
  3. compression.type=gzip
  4. reconnect.backoff.ms=1000
  5. value.serializer=org.apache.kafka.common.serialization.ByteArraySerializer
  6. key.serializer=org.apache.kafka.common.serialization.ByteArraySerializer
  7. # 100KB per partition
  8. batch.size=102400
  9. linger.ms=10000
kafka.props:
  1. gg.handlerlist = kafkahandler
  2. gg.handler.kafkahandler.type = kafka
  3. gg.handler.kafkahandler.KafkaProducerConfigFile=custom_kafka_producer.properties
  4. gg.handler.kafkahandler.TopicName =oggtopic
  5. gg.handler.kafkahandler.format =avro_op #有多种模式可以选 xmldelimitedtextjsonavro_rowavro_op
  6. gg.handler.kafkahandler.SchemaTopicName=mySchemaTopic
  7. gg.handler.kafkahandler.BlockingSend =false #阻塞模式
  8. gg.handler.kafkahandler.includeTokens=false
  9. gg.handler.kafkahandler.mode =tx #可选OP/TX,OP每次ORACLE的操作(I D U)都会当作生产者消费者的记录刷新一次,TX按事务提交刷新
  10. #gg.handler.kafkahandler.maxGroupSize =100, 1Mb
  11. #gg.handler.kafkahandler.minGroupSize =50, 500Kb
  12. goldengate.userexit.timestamp=utc
  13. goldengate.userexit.writers=javawriter
  14. javawriter.stats.display=TRUE
  15. javawriter.stats.full=TRUE
  16. gg.log=log4j
  17. gg.log.level=INFO
  18. gg.report.time=30sec
  19. gg.classpath=dirprm/:/opt/cloudera/parcels/KAFKA/lib/kafka/libs/*:
  20. javawriter.bootoptions=-Xmx512m -Xms32m -Djava.class.path=ggjava/ggjava.jar
rkafka.prm:
  1. REPLICAT rkafka
  2. TARGETDB LIBFILE libggjava.so SET property=dirprm/kafka.props
  3. REPORTCOUNT EVERY 1 MINUTES, RATE
  4. GROUPTRANSOPS 10000
  5. MAP XDGL.BUSINESS_CONTRACT , TARGET XDGL.BUSINESS_CONTRACT;

2.添加kafka复制进程




















posted on 2017-08-31 00:18  月饼馅饺子  阅读(1569)  评论(0编辑  收藏  举报

导航