rabbitmq

package module
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package rabbitmq provides a RabbitMQ driver for ncore/data.

This driver uses amqp091-go (github.com/rabbitmq/amqp091-go) as the underlying AMQP 0-9-1 client library. It registers itself automatically when imported:

import _ "github.com/ncobase/ncore/data/rabbitmq"

The driver supports RabbitMQ connection configuration including connection URLs, virtual hosts, and connection parameters.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RabbitMQ

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

RabbitMQ represents RabbitMQ implementation

func NewRabbitMQ

func NewRabbitMQ(conn *amqp.Connection) *RabbitMQ

NewRabbitMQ creates new RabbitMQ connection

func NewRabbitMQWithConfig

func NewRabbitMQWithConfig(conn *amqp.Connection, messaging *config.Messaging) *RabbitMQ

NewRabbitMQWithConfig creates new RabbitMQ with messaging config

func (*RabbitMQ) Close

func (s *RabbitMQ) Close() error

Close closes the RabbitMQ service

func (*RabbitMQ) ConsumeMessages

func (s *RabbitMQ) ConsumeMessages(queue string, handler func([]byte) error) error

ConsumeMessages consumes messages from RabbitMQ

func (*RabbitMQ) IsConnected

func (s *RabbitMQ) IsConnected() bool

IsConnected checks if the RabbitMQ connection is valid

func (*RabbitMQ) PublishMessage

func (s *RabbitMQ) PublishMessage(exchange, routingKey string, body []byte) error

PublishMessage publishes message to RabbitMQ

Jump to

Keyboard shortcuts

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