pulsarutils

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMessageId

func NewMessageId(id int) pulsar.MessageID

func NewPulsarClient

func NewPulsarClient(config *commonconfig.PulsarConfig) (pulsar.Client, error)

Types

type MockMessageId

type MockMessageId struct {
	pulsar.MessageID
	// contains filtered or unexported fields
}

type MockPulsarMessage

type MockPulsarMessage struct {
	pulsar.Message
	// contains filtered or unexported fields
}

func NewPulsarMessage

func NewPulsarMessage(id int, publishTime time.Time, payload []byte) MockPulsarMessage

func (MockPulsarMessage) ID

func (MockPulsarMessage) Payload

func (m MockPulsarMessage) Payload() []byte

func (MockPulsarMessage) Properties

func (m MockPulsarMessage) Properties() map[string]string

func (MockPulsarMessage) PublishTime

func (m MockPulsarMessage) PublishTime() time.Time

type Publisher added in v0.4.44

type Publisher[T utils.ArmadaEvent] interface {
	PublishMessages(ctx *armadacontext.Context, events ...T) error
	Close()
}

Publisher is an interface to be implemented by structs that handle publishing messages to pulsar

type PulsarPublisher added in v0.4.44

type PulsarPublisher[T utils.ArmadaEvent] struct {
	// contains filtered or unexported fields
}

PulsarPublisher is the default implementation of Publisher

func NewPulsarPublisher added in v0.4.44

func NewPulsarPublisher[T utils.ArmadaEvent](
	pulsarClient pulsar.Client,
	producerOptions pulsar.ProducerOptions,
	preProcessor psutils.PreProcessor[T],
	keyRetriever psutils.KeyRetriever[T],
	sendTimeout time.Duration,
) (*PulsarPublisher[T], error)

func (*PulsarPublisher[T]) Close added in v0.4.44

func (p *PulsarPublisher[T]) Close()

func (*PulsarPublisher[T]) PublishMessages added in v0.4.44

func (p *PulsarPublisher[T]) PublishMessages(ctx *armadacontext.Context, events ...T) error

PublishMessages publishes all event sequences to pulsar. Event sequences for a given jobset will be combined into single event sequences up to maxMessageBatchSize.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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