producer

package
v0.0.0-...-c7f2e70 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BootStrapServersKey                = "bootstrap.servers"
	SecurityProtocolKey                = "security.protocol"
	DefaultSecurityProtocol            = "plaintext"
	DefaultProducerFlushTimeoutSeconds = 15
)

Variables

This section is empty.

Functions

This section is empty.

Types

type IKafkaProducer

type IKafkaProducer interface {
	PushMessageToTopic(msg interface{}, partition int32) error
}

func NewKafkaProducer

func NewKafkaProducer(l *log.Logger, config *KafkaProducerConfig) (IKafkaProducer, error)

type KafkaProducer

type KafkaProducer struct {
	// contains filtered or unexported fields
}

func (*KafkaProducer) PushMessageToTopic

func (k *KafkaProducer) PushMessageToTopic(msg interface{}, partition int32) error

type KafkaProducerConfig

type KafkaProducerConfig struct {
	//(Optional) The name of the producer
	Name string `json:"name"`

	//(Mandatory) The topic to which this producer needs to push the data
	TopicToPush string `json:"topic_to_push"`

	//(Optional) The security protocol that needs to be used
	SecurityProtocol string `json:"security_protocol"`

	//(Mandatory) The kakfa broker URLs.
	BrokerURLs []string `json:"broker_urls"`

	//(Optional) The flush timeout Secs
	FlushTimeoutSecs int `json:"flush_timeout_seconds"`
}

Jump to

Keyboard shortcuts

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