mq

package
v0.0.0-...-a64f145 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 23, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KafkaClient

type KafkaClient struct {
	Brokers []string
	Topic   string
	GroupID string
}

func NewKafkaClient

func NewKafkaClient(brokers []string, topic, groupID string) *KafkaClient

func (*KafkaClient) Consume

func (k *KafkaClient) Consume(ctx context.Context, handler func(msg kafka.Message) error) error

消费消息,handler是业务处理函数

func (*KafkaClient) Produce

func (k *KafkaClient) Produce(ctx context.Context, key, value []byte) error

发送消息

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL