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 ¶
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"` }
Click to show internal directories.
Click to hide internal directories.