Documentation ¶
Index ¶
- func BuildConsumerGroupConfig(conf *Config, initial int64, autoCommitEnable bool) (*sarama.Config, error)
- func BuildProducerConfig(conf Config) (*sarama.Config, error)
- func Check(ctx context.Context, conf *Config, topics []string) error
- func GetContextWithMQHeader(header []*sarama.RecordHeader) context.Context
- func GetMQHeaderWithContext(ctx context.Context) ([]sarama.RecordHeader, error)
- func NewConsumerGroup(conf *sarama.Config, addr []string, groupID string) (sarama.ConsumerGroup, error)
- func NewProducer(conf *sarama.Config, addr []string) (sarama.SyncProducer, error)
- type Config
- type MConsumerGroup
- type Producer
- 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.
func NewConsumerGroup ¶
func NewProducer ¶
Types ¶
type MConsumerGroup ¶
type MConsumerGroup struct { sarama.ConsumerGroup // contains filtered or unexported fields }
func NewMConsumerGroup ¶
func (*MConsumerGroup) Close ¶
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 Producer ¶
type Producer struct {
// contains filtered or unexported fields
}
Producer represents a Kafka producer.
func NewKafkaProducer ¶
Click to show internal directories.
Click to hide internal directories.