rocketmq

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Publisher

type Publisher struct {
	// contains filtered or unexported fields
}

func NewPublisher

func NewPublisher(
	config PublisherConfig,
	logger watermill.LoggerAdapter,
) (*Publisher, error)

func (*Publisher) Close

func (p *Publisher) Close() error

Close closes the publisher

func (*Publisher) Publish

func (p *Publisher) Publish(key string, msg aliRocketSDK.PublishMessageRequest) (err error)

type PublisherConfig

type PublisherConfig struct {
	Endpoint   string
	AccessKey  string
	SecretKey  string
	Token      string
	InstanceID string
	Topic      string
}

PublisherConfig the rocketmq publisher config

type Subscriber

type Subscriber struct {
	// contains filtered or unexported fields
}

func NewSubscriber

func NewSubscriber(
	config SubscriberConfig,
	logger watermill.LoggerAdapter,
) *Subscriber

func (*Subscriber) Close

func (s *Subscriber) Close() error

func (*Subscriber) Subscribe

func (s *Subscriber) Subscribe(ctx context.Context, topic string) (<-chan *message.Message, error)

type SubscriberConfig

type SubscriberConfig struct {
	Endpoint            string
	AccessKey           string
	SecretKey           string
	Token               string
	InstanceID          string
	GroupID             string
	Topic               string
	ReconnectRetrySleep time.Duration
}

Jump to

Keyboard shortcuts

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