kafka

package
v1.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 15, 2019 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package kafka 通用写kafka接口 Created by chenguolin 2018-09-21

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewSyncKafkaProducer

func NewSyncKafkaProducer(brokers string) (*kafka.SyncProducer, error)

NewSyncKafkaProducer 实例化一个kafka producer

func WriteKafka

func WriteKafka(producer *kafka.SyncProducer, topic, key, value string, retryTimes int) error

WriteKafka 写Kafka消息接口 kafkaProducer 生产者对象 topic 要写的topic key 消息key value 消息内容 retryTimes 重试次数

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL