rabbitmqbus

package
v0.0.0-...-f491d07 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EventBus

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

func NewEventBus

func NewEventBus(url string, options ...Option) (*EventBus, error)

NewEventBus creates an EventBus, with optional settings.

func (*EventBus) Ack

func (b *EventBus) Ack(receive *rabbitmqpools.ConsumeReceive, msg *amqp.Delivery) error

func (*EventBus) AddHandler

func (b *EventBus) AddHandler(m eh.EventType, h eh.EventHandler, args interface{}) error

AddHandler implements the AddHandler method of the contracts.EventBus interface.

func (*EventBus) Close

func (b *EventBus) Close() error

Close implements the Close method of the contracts.EventBus interface.

func (*EventBus) ErrorPrint

func (b *EventBus) ErrorPrint()

func (*EventBus) Errors

func (b *EventBus) Errors() <-chan error

Errors implements the Errors method of the contracts.EventBus interface.

func (*EventBus) HandlerType

func (b *EventBus) HandlerType() eh.EventHandlerType

HandlerType implements the HandlerType method of the EventHandler interface.

func (*EventBus) Publish

func (b *EventBus) Publish(exChangeName string, exChangeType string, queueName string, route string, msg string) error

publish message

type Option

type Option func(*EventBus) error

Option is an option setter used to configure creation.

func WithCodec

func WithCodec(codec msgCodec.EventCodec) Option

WithCodec uses the specified codec for encoding events.

func WithLogger

func WithLogger(logger logx.ILogger) Option

func WithMaxConsumeCount

func WithMaxConsumeCount(consumeCount int32) Option

consume count

func WithMessageTimeToAlive

func WithMessageTimeToAlive(timeAlive int64) Option

messageTime to alive

func WithRollBackCount

func WithRollBackCount(count int32) Option

retry count

func WithUrl

func WithUrl(url string) Option

Jump to

Keyboard shortcuts

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