Home > Net >  create queue quorum rabbitmq in golan by streadway module
create queue quorum rabbitmq in golan by streadway module

Time:09-14

hi i want create queue Quorum in Rabbitmq with GO and i write this code below

deliveries, err := c.channel.Consume(
    queue.Name, // name
    c.tag,      // consumerTag,
    false,      // noAck
    false,      // exclusive
    false,      // noLocal
    false,      // noWait
    amqp.Table{
        "x-queue-type": "quorum",
    }, // arguments )

but queue made of type classic not quorum

CodePudding user response:

You need to use the QueueDeclare function to declare a queue with arguments before you consume from it.

args := Table{"x-queue-type": "quorum"}
channel.QueueDeclare(queue.Name,
    true,   // durable
    false,  // autoDelete
    false,  // exclusive
    false,  // wait for response
    args    // queue arguments
)

NOTE: the RabbitMQ team monitors the rabbitmq-users mailing list and only sometimes answers questions on StackOverflow.

  • Related