Documentation ¶
Index ¶
Constants ¶
View Source
const ( // Kafka's usage Partition Schemes PARTIONER_HASH = "hash" PARTIONER_RANDOM = "random" PARTIONER_MANUAL = "manual" COMPRESSION_NONE = "compression_none" COMPRESSION_SNAPY = "compression_snappy" COMPRESSION_GZIP = "compression_gzip" )
Variables ¶
This section is empty.
Functions ¶
func ParseConfiguration ¶
Parses the producer YAML configuration file. Example"
broker_list: "localhost:9093,localhost:9095,localhost:9095" topic: "kafka_topic" partition: 0 offset: 1000 verbose: true
func ValidateConfiguration ¶
func ValidateConfiguration(configuration interface{}) error
Validates producer YAML configuration file.
Types ¶
type KafkaConsumerConfig ¶
type KafkaConsumerConfig struct { BrokerList string `yaml:"broker_list"` // Kafka broker list of Kafka servers (comma separated) Topic string `yaml:"topic"` // Topic to listen Partitions string `yaml:"partitions"` // Partitions to listen: 'all' or comma separated numbers [0, #P-1] Offset string `yaml:"offset"` // Offset from which the consumer starts receiving messages BufferSize int `yaml:"buffer_size"` // The consumer message buffer size Verbose bool `yaml:"verbose"` // Enable verbose mode on the Kafka API }
Configurattion structure of the Kafka consumer
type KafkaProducerConfig ¶
type KafkaProducerConfig struct { BrokerList string `yaml:"broker_list"` // Kafka broker list of Kafka servers (comma separated) ClientId string `yaml:"client_id"` // The client's ID Topic string `yaml:"topic"` // Topic to listen Partitioner string `yaml:"partitioner"` // Partitioner mode 'random', 'hash' or 'manual' Partition int `yaml:"partition"` // Partition to use (ony in 'manual' case) CompressionType string `yaml:"compression_type"` // Comppression type: 'compression_none', 'compression_snappy', 'compression_gzip' Verbose bool `yaml:"verbose"` // Enable verbose mode on the Kafka API }
Configuration structure of the Kafka Producer
Click to show internal directories.
Click to hide internal directories.