rabbitmq

package
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2025 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckHealth added in v1.0.4

func CheckHealth() []string

CheckHealth performs health checks and returns any issues

func IncrementMessagesReceived added in v1.0.4

func IncrementMessagesReceived()

IncrementMessagesReceived increments the received message counter

func IncrementMessagesSent added in v1.0.4

func IncrementMessagesSent()

IncrementMessagesSent increments the sent message counter

func LogStats added in v1.0.4

func LogStats()

LogStats logs current statistics

func RecordError added in v1.0.4

func RecordError(err error)

RecordError records an error in the stats

func StartMonitoring added in v1.0.4

func StartMonitoring(interval time.Duration)

StartMonitoring starts periodic monitoring (call this once at startup)

Types

type ChannelManager added in v1.0.4

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

ChannelManager manages per-goroutine channel allocation and reuse

func NewChannelManager added in v1.0.4

func NewChannelManager(conn *PooledConnection) *ChannelManager

NewChannelManager creates a new channel manager for a connection

func (*ChannelManager) CloseAll added in v1.0.4

func (cm *ChannelManager) CloseAll() error

CloseAll closes all channels in the manager

func (*ChannelManager) GetChannel added in v1.0.4

func (cm *ChannelManager) GetChannel() (*PooledChannel, error)

GetChannel returns a channel for the current goroutine, creating it if necessary

func (*ChannelManager) GetStats added in v1.0.4

func (cm *ChannelManager) GetStats() map[string]interface{}

GetStats returns channel manager statistics

func (*ChannelManager) RecreateChannel added in v1.0.4

func (cm *ChannelManager) RecreateChannel(gid uint64) (*PooledChannel, error)

RecreateChannel attempts to recreate a channel

type ConnectionPool added in v1.0.4

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

ConnectionPool manages a single connection per vhost with automatic reconnection

func GetConnectionPool added in v1.0.4

func GetConnectionPool() *ConnectionPool

GetConnectionPool returns the global connection pool singleton

func (*ConnectionPool) CloseAll added in v1.0.4

func (cp *ConnectionPool) CloseAll() error

CloseAll closes all connections in the pool

func (*ConnectionPool) GetConnection added in v1.0.4

func (cp *ConnectionPool) GetConnection(dsn string, config amqp091.Config) (*PooledConnection, error)

GetConnection returns a connection for the given DSN, creating it if necessary

func (*ConnectionPool) GetStats added in v1.0.4

func (cp *ConnectionPool) GetStats() map[string]interface{}

GetStats returns connection pool statistics

type Engine

type Engine struct {
	Debug bool
	// contains filtered or unexported fields
}

Engine for controller

func (*Engine) Call

func (me *Engine) Call(name string, event *types.Event)

func (*Engine) Event

func (me *Engine) Event(name string, handler func(*types.Event))

type MonitoringStats added in v1.0.4

type MonitoringStats struct {
	ConnectionCount  int
	ActiveChannels   int
	TotalChannels    int
	MessagesSent     uint64
	MessagesReceived uint64
	ErrorCount       uint64
	LastError        string
	LastErrorTime    time.Time
	UptimeSeconds    int64
	PoolUtilization  float64
}

MonitoringStats holds RabbitMQ performance metrics

func GetStats added in v1.0.4

func GetStats() MonitoringStats

GetStats returns current monitoring statistics

type PooledChannel added in v1.0.4

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

PooledChannel represents a channel with automatic recreation capability

func (*PooledChannel) Close added in v1.0.4

func (pc *PooledChannel) Close() error

Close gracefully closes the channel

func (*PooledChannel) GetRawChannel added in v1.0.4

func (pc *PooledChannel) GetRawChannel() *amqp091.Channel

GetRawChannel returns the underlying amqp091.Channel

func (*PooledChannel) IsClosed added in v1.0.4

func (pc *PooledChannel) IsClosed() bool

IsClosed checks if the channel is closed

type PooledConnection added in v1.0.4

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

PooledConnection represents a single RabbitMQ connection with reconnection logic

func (*PooledConnection) Close added in v1.0.4

func (pc *PooledConnection) Close() error

Close gracefully closes the connection

func (*PooledConnection) GetRawConnection added in v1.0.4

func (pc *PooledConnection) GetRawConnection() *amqp091.Connection

GetRawConnection returns the underlying amqp091.Connection (read-only access)

func (*PooledConnection) IsClosed added in v1.0.4

func (pc *PooledConnection) IsClosed() bool

IsClosed checks if the connection is closed

Jump to

Keyboard shortcuts

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