Documentation ¶
Index ¶
- type Option
- func WithBrokerList(brokers string) Option
- func WithChannelBufferSize(channelBufferSize int) Option
- func WithClientID(clientId string) Option
- func WithCompression(compression string) Option
- func WithFlushBytes(flushBytes int) Option
- func WithFlushFrequencyMs(flushFrequencyMs int) Option
- func WithFlushMaxMessages(flushMaxMessages int) Option
- func WithFlushMessages(flushMessages int) Option
- func WithMaxMessageBytes(maxMessageBytes int) Option
- func WithMaxOpenRequests(maxOpenRequests int) Option
- func WithPartitioning(partitioning string) Option
- func WithRequiredAcks(requiredAcks int) Option
- func WithRetryMaxCn(retryMaxCn int) Option
- func WithTimeOut(timeOut time.Duration) Option
- func WithVersion(version string) Option
- type Producer
- type ProducerOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option interface {
// contains filtered or unexported methods
}
func WithChannelBufferSize ¶
func WithClientID ¶
The client ID sent with every request to the brokers.
func WithCompression ¶
func WithFlushBytes ¶
func WithFlushFrequencyMs ¶
func WithFlushMaxMessages ¶
func WithFlushMessages ¶
func WithMaxMessageBytes ¶
func WithMaxOpenRequests ¶
func WithPartitioning ¶
key partition: partition(manual),hash,random - manual partitioning if a partition number is provided - hash partitioning by msg key - random partitioning otherwise.
func WithRequiredAcks ¶
RequiredAcks is used in Produce Requests to tell the broker how many replica acknowledgements it must see before responding. Any of the constants defined here are valid. On broker versions prior to 0.8.2.0 any other positive int16 is also valid (the broker will wait for that many acknowledgements) but in 0.8.2.0 and later this will raise an exception (it has been replaced by setting the `min.isr` value in the brokers configuration). 0: NoResponse doesn't send any response, the TCP ACK is all you get. 1: WaitForLocal waits for only the local commit to succeed before responding. -1: WaitForAll waits for all in-sync replicas to commit before responding. The minimum number of in-sync replicas is configured on the broker via the `min.insync.replicas` configuration key.
func WithRetryMaxCn ¶
func WithTimeOut ¶
The duration the producer will wait to receive -required-acks
func WithVersion ¶
kafka version support kafka min version 0.8.2.0
type Producer ¶
type Producer struct {
// contains filtered or unexported fields
}
type ProducerOptions ¶
type ProducerOptions struct { *auth.AuthOptions // contains filtered or unexported fields }