rocketmq

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewBroker

func NewBroker(config Config) (broker.IBroker, error)

Types

type Broker

type Broker struct {
	*broker.Broker
	// contains filtered or unexported fields
}

func (*Broker) Close

func (b *Broker) Close() error

func (*Broker) Send

func (b *Broker) Send(ctx context.Context, name string, value interface{}) error

func (*Broker) SendDelay

func (b *Broker) SendDelay(ctx context.Context, name string, value interface{}, delay time.Duration) error

func (*Broker) Worker

func (b *Broker) Worker() error

type Config

type Config struct {
	Hosts             []string
	Topic             string
	ProducerGroupName string
	ConsumerGroupName string
	Order             bool
	BroadCasting      bool
	// default processId, warning: using defaults can be problematic when docker is deployed
	InstanceName string
	// Strategy Algorithm for message allocating between consumers. reference: https://github.com/apache/rocketmq-client-go/blob/master/consumer/strategy.go
	AllocateStrategy func(string, string, []*primitive.MessageQueue, []string) []*primitive.MessageQueue
	// The maximum number of times the message is re-consumed. default 16 times.
	RetryMaxReconsume uint8
	// The Duration of backoff to apply between retries.
	//Backoff time.Duration
	Codec codec.Codec
	// Define the concurrency number of worker processes, default runtime.NumCPU()*2
	//Concurrency int
	// A Logger represents an active logging object that generates lines of output to an io.Writer
	Logger log.ILogger
}

Jump to

Keyboard shortcuts

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