queue opts

This commit is contained in:
nquidox 2026-04-27 00:06:46 +03:00
parent 9b9d8a3064
commit fd495892fa
2 changed files with 29 additions and 11 deletions

View file

@ -78,7 +78,16 @@ func (c *Client) init(conn *amqp.Connection) error {
return err
}
_, err = ch.QueueDeclare(c.queueName, false, false, false, false, nil)
//_, err = ch.QueueDeclare(c.queueName, false, false, false, false, nil)
_, err = ch.QueueDeclare(
c.queueOptions.QueueName,
c.queueOptions.Durable,
c.queueOptions.AutoDelete,
c.queueOptions.Exclusive,
c.queueOptions.NoWait,
c.queueOptions.Args,
)
if err != nil {
return err
}
@ -120,7 +129,7 @@ func (c *Client) unsafePush(data []byte) error {
return c.Channel.PublishWithContext(
ctx,
"",
c.queueName,
c.queueOptions.QueueName,
false,
false,
amqp.Publishing{
@ -147,7 +156,7 @@ func (c *Client) consume() (<-chan amqp.Delivery, error) {
}
return c.Channel.Consume(
c.queueName,
c.queueOptions.QueueName,
"",
false,
false,