store assigned queue name in client

alpha v1.0.8
alex 2023-01-07 20:30:41 +01:00
parent 405da51af3
commit 1e6f57717a
1 changed files with 15 additions and 12 deletions

View File

@ -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)
}