parent
405da51af3
commit
1e6f57717a
27
client.go
27
client.go
|
@ -81,17 +81,18 @@ type QueueConsumeSettings struct {
|
|||
}
|
||||
|
||||
type Client struct {
|
||||
exchangeSettings ExchangeSettings
|
||||
queueSettings QueueSettings
|
||||
config Config
|
||||
logger *log.Logger
|
||||
connection *amqp.Connection
|
||||
Channel *amqp.Channel
|
||||
done chan bool
|
||||
notifyConnClose chan *amqp.Error
|
||||
notifyChanClose chan *amqp.Error
|
||||
notifyConfirm chan amqp.Confirmation
|
||||
isReady bool
|
||||
exchangeSettings ExchangeSettings
|
||||
queueSettings QueueSettings
|
||||
AssignedQueueName string // automatically assigned queue name if none is specified
|
||||
config Config
|
||||
logger *log.Logger
|
||||
connection *amqp.Connection
|
||||
Channel *amqp.Channel
|
||||
done chan bool
|
||||
notifyConnClose chan *amqp.Error
|
||||
notifyChanClose chan *amqp.Error
|
||||
notifyConfirm chan amqp.Confirmation
|
||||
isReady bool
|
||||
}
|
||||
|
||||
func GetConnectionString(username string, password string, host string) string {
|
||||
|
@ -214,7 +215,7 @@ func (client *Client) init(conn *amqp.Connection) error {
|
|||
|
||||
client.changeChannel(ch)
|
||||
} else {
|
||||
_, err = ch.QueueDeclare(
|
||||
q, err := ch.QueueDeclare(
|
||||
client.queueSettings.Name,
|
||||
client.queueSettings.Durable,
|
||||
client.queueSettings.DeleteWhenUnused,
|
||||
|
@ -227,6 +228,8 @@ func (client *Client) init(conn *amqp.Connection) error {
|
|||
return err
|
||||
}
|
||||
|
||||
client.AssignedQueueName = q.Name
|
||||
|
||||
client.changeChannel(ch)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue