rabbitmq

package
v2.0.45 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RabbitMQ

type RabbitMQ struct {
	Url               string
	ReconnectInterval int
	Handler           []rabbitmq.Handler
	Config            rabbitmq.Config

	ConsumerOptions *rabbitmq.ConsumerOptions

	PublisherOptions *rabbitmq.PublisherOptions
	Logger           rabbitmq.Logger
	// contains filtered or unexported fields
}

RabbitMQ cache implement

func NewRabbitMQ

func NewRabbitMQ(
	ctx context.Context,
	dsn string,
	reconnectInterval int,
	cfg *rabbitmq.Config,
	logger rabbitmq.Logger,
) (*RabbitMQ, error)

func (*RabbitMQ) Consumer

func (r *RabbitMQ) Consumer(ctx context.Context, queueName string, consumerFunc queueLib.ConsumerFunc, optionFuncs ...func(*queueLib.ConsumeOptions))

Consumer 监听消费者

func (*RabbitMQ) Publish

func (r *RabbitMQ) Publish(ctx context.Context, message messageLib.IMessage, optionFuncs ...func(*queueLib.PublishOptions)) error

Publish 消息入生产者

func (*RabbitMQ) RpcRequest added in v2.0.23

func (r *RabbitMQ) RpcRequest(ctx context.Context, key string, data []byte, optionFuncs ...func(*queueLib.ClientOptions)) ([]byte, error)

RpcRequest AMQP RPC Request

func (*RabbitMQ) Run

func (r *RabbitMQ) Run(ctx context.Context)

func (*RabbitMQ) Shutdown

func (r *RabbitMQ) Shutdown(ctx context.Context)

func (*RabbitMQ) String

func (r *RabbitMQ) String() string

Jump to

Keyboard shortcuts

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