Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,25 @@ func (c *Client) deletePublisher(pub *Publisher) {
delete(c.publishers, pub)
}

// QueueInspect returns information about a queue, including number
// of messages and consumers.
func (c *Client) QueueInspect(name string) (*amqp.Queue, error) {
conn, _ := c.conn.Load().(*amqp.Connection)
if conn == nil {
return nil, ErrNoConnection
}
ch, err := conn.Channel()
if err != nil {
return nil, err
}
defer ch.Close()
state, err := ch.QueueInspect(name)
if err != nil {
return nil, err
}
return &state, nil
}

// Errors returns AMQP connection level errors. Default buffer size is 100.
// Messages will be dropped in case if receiver can't keep up
func (c *Client) Errors() <-chan error {
Expand Down