Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetContextWithMQHeader ¶
func GetContextWithMQHeader(header []*sarama.RecordHeader) context.Context
func GetMQHeaderWithContext ¶
func GetMQHeaderWithContext(ctx context.Context) ([]sarama.RecordHeader, error)
func SetupTLSConfig ¶
SetupTLSConfig set up the TLS config from config file.
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) *MConsumerGroup
func (*MConsumerGroup) GetContextFromMsg ¶
func (mc *MConsumerGroup) GetContextFromMsg(cMsg *sarama.ConsumerMessage) context.Context
func (*MConsumerGroup) RegisterHandleAndConsumer ¶
func (mc *MConsumerGroup) RegisterHandleAndConsumer(handler sarama.ConsumerGroupHandler)
type MConsumerGroupConfig ¶
type MConsumerGroupConfig struct { KafkaVersion sarama.KafkaVersion OffsetsInitial int64 IsReturnErr bool }
type Producer ¶
type Producer struct {
// contains filtered or unexported fields
}
func NewKafkaProducer ¶
NewKafkaProducer Initialize kafka producer.
Click to show internal directories.
Click to hide internal directories.