pulsar

package
v1.9.1 Latest Latest
Warning

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

Go to latest
Published: May 29, 2023 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	pulsar.Client
}

func NewClient

func NewClient(config *config.Config) (Client, error)

NewClient returns a new instance of Pulsar client

func (*Client) NewProducer

func (c *Client) NewProducer(opts pulsar.ProducerOptions) (ProducerAdapter, error)

NewProducer returns a new instance of Pulsar producer

type ClientConf

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

type Producer

type Producer struct {
	pulsar.Producer
}

func (*Producer) SendMessage

func (p *Producer) SendMessage(ctx context.Context, key, orderingKey string, msg []byte) error

SendMessage sends a message to pulsar synchronously

func (*Producer) SendMessageAsync

func (p *Producer) SendMessageAsync(ctx context.Context, key, orderingKey string, msg []byte, statusfunc func(id pulsar.MessageID, message *pulsar.ProducerMessage, err error))

SendMessageAsync sends a message to pulsar asynchronously

type ProducerAdapter

type ProducerAdapter interface {
	SendMessage(ctx context.Context, key, orderingKey string, msg []byte) error
	SendMessageAsync(ctx context.Context, key, orderingKey string, msg []byte, statusFunc func(id pulsar.MessageID, message *pulsar.ProducerMessage, err error))
	Close()
	Flush() error
}

Jump to

Keyboard shortcuts

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