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 ¶ added in v0.0.48
func GetContextWithMQHeader(header []*sarama.RecordHeader) context.Context
GetContextWithMQHeader creates a context from message queue headers.
func GetMQHeaderWithContext ¶ added in v0.0.48
func GetMQHeaderWithContext(ctx context.Context) ([]sarama.RecordHeader, error)
GetMQHeaderWithContext extracts message queue headers from the context.
func NewConsumerGroup ¶
func NewProducer ¶
Types ¶
type MConsumerGroup ¶ added in v0.0.48
type MConsumerGroup struct { sarama.ConsumerGroup // contains filtered or unexported fields }
func NewMConsumerGroup ¶ added in v0.0.48
func (*MConsumerGroup) Close ¶ added in v0.0.48
func (mc *MConsumerGroup) Close() error
func (*MConsumerGroup) GetContextFromMsg ¶ added in v0.0.48
func (mc *MConsumerGroup) GetContextFromMsg(cMsg *sarama.ConsumerMessage) context.Context
func (*MConsumerGroup) RegisterHandleAndConsumer ¶ added in v0.0.48
func (mc *MConsumerGroup) RegisterHandleAndConsumer(ctx context.Context, handler sarama.ConsumerGroupHandler)
type Producer ¶ added in v0.0.48
type Producer struct {
// contains filtered or unexported fields
}
Producer represents a Kafka producer.
func NewKafkaProducer ¶ added in v0.0.48
Click to show internal directories.
Click to hide internal directories.