Documentation ¶
Index ¶
- func New(cnf *config.Config) iface.Broker
- type AMQPConnection
- type Broker
- func (b *Broker) AdjustRoutingKey(s *tasks.Signature)
- func (b *Broker) CloseConnections() error
- func (b *Broker) GetOrOpenConnection(queueName string, queueBindingKey string, ...) (*AMQPConnection, error)
- func (b *Broker) Publish(ctx context.Context, signature *tasks.Signature) error
- func (b *Broker) StartConsuming(consumerTag string, concurrency int, taskProcessor iface.TaskProcessor) (bool, error)
- func (b *Broker) StopConsuming()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AMQPConnection ¶
type AMQPConnection struct {
// contains filtered or unexported fields
}
type Broker ¶
type Broker struct { common.Broker common.AMQPConnector // contains filtered or unexported fields }
Broker represents an AMQP broker
func (*Broker) AdjustRoutingKey ¶
AdjustRoutingKey makes sure the routing key is correct. If the routing key is an empty string: a) set it to binding key for direct exchange type b) set it to default queue name
func (*Broker) CloseConnections ¶
func (*Broker) GetOrOpenConnection ¶
func (b *Broker) GetOrOpenConnection(queueName string, queueBindingKey string, exchangeDeclareArgs, queueDeclareArgs, queueBindingArgs amqp.Table) (*AMQPConnection, error)
GetOrOpenConnection will return a connection on a particular queue name. Open connections are saved to avoid having to reopen connection for multiple queues
func (*Broker) StartConsuming ¶
func (b *Broker) StartConsuming(consumerTag string, concurrency int, taskProcessor iface.TaskProcessor) (bool, error)
StartConsuming enters a loop and waits for incoming messages
Click to show internal directories.
Click to hide internal directories.