mq

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

************************** @File : product.go @Time : 2022/06/16 15:50:23 @AUTHOR : small_ant @Email : xms.chnb@gmail.com @Desc : kafka producer ***************************

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewProducerMes

func NewProducerMes(mes, topic, key string, timestamp time.Time) *sarama.ProducerMessage

Types

type Config

type Config struct {
	Addr   []string // kafka地址
	Topic  string   // kafka topic
	Key    string   // kafka key
	Expire int64    // 过期时间
}

func (*Config) Consumer

func (c *Config) Consumer() ([]byte, error)

Consumer is a sarama consumer 消费队列

func (*Config) Metadata

func (c *Config) Metadata() (*sarama.Client, error)

Metadata client

func (*Config) ProducerSend

func (c *Config) ProducerSend(mes *sarama.ProducerMessage) error

Jump to

Keyboard shortcuts

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