Documentation ¶
Index ¶
- func GetContextWithMQHeader(header []*sarama.RecordHeader) context.Context
- func GetMQHeaderWithContext(ctx context.Context) ([]sarama.RecordHeader, error)
- func SetupTLSConfig(cfg *sarama.Config, tlsConfig *TLSConfig) error
- type Consumer
- type MConsumerGroup
- type MConsumerGroupConfig
- type Producer
- type ProducerConfig
- type TLSConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetContextWithMQHeader ¶
func GetContextWithMQHeader(header []*sarama.RecordHeader) context.Context
GetContextWithMQHeader creates a context from message queue headers.
func GetMQHeaderWithContext ¶
func GetMQHeaderWithContext(ctx context.Context) ([]sarama.RecordHeader, error)
GetMQHeaderWithContext extracts message queue headers from the context.
Types ¶
type Consumer ¶
type Consumer struct { WG sync.WaitGroup Topic string PartitionList []int32 Consumer sarama.Consumer // contains filtered or unexported fields }
func NewKafkaConsumer ¶
type MConsumerGroup ¶
type MConsumerGroup struct { sarama.ConsumerGroup // contains filtered or unexported fields }
func NewMConsumerGroup ¶
func NewMConsumerGroup(consumerConfig *MConsumerGroupConfig, topics, addrs []string, groupID string, tlsConfig *TLSConfig) (*MConsumerGroup, error)
func (*MConsumerGroup) Close ¶ added in v3.6.0
func (mc *MConsumerGroup) Close() error
func (*MConsumerGroup) GetContextFromMsg ¶
func (mc *MConsumerGroup) GetContextFromMsg(cMsg *sarama.ConsumerMessage) context.Context
func (*MConsumerGroup) RegisterHandleAndConsumer ¶
func (mc *MConsumerGroup) RegisterHandleAndConsumer(ctx context.Context, handler sarama.ConsumerGroupHandler)
type MConsumerGroupConfig ¶
type Producer ¶
type Producer struct {
// contains filtered or unexported fields
}
Producer represents a Kafka producer.
func NewKafkaProducer ¶
func NewKafkaProducer(addr []string, topic string, producerConfig *ProducerConfig, tlsConfig *TLSConfig) (*Producer, error)
NewKafkaProducer initializes a new Kafka producer.
type ProducerConfig ¶ added in v3.6.0
Click to show internal directories.
Click to hide internal directories.