wagslane / go-rabbitmq

A wrapper of streadway/amqp that provides reconnection logic and sane defaults
https://blog.boot.dev/golang/connecting-to-rabbitmq-in-golang-easy/
MIT License
797 stars 129 forks source link

Access refused when trying to bind router to queue #3

Closed trancong12102 closed 3 years ago

trancong12102 commented 3 years ago

Dear sir, I have "ACCESS_REFUSED - operation not permitted on the default exchange" error when trying your consumer example. This is my code

consumer, err := rabbitmq.NewConsumer(env.RabbitMqUrl)
    handleError(err, "Create consumer", true)

    err = consumer.StartConsuming(
        func(d rabbitmq.Delivery) bool {
            log.Printf("Consumed: %s", d.Body)

            return true
        },
        "runner_sandbox_worker",
        []string{"runner_sandbox_routing"},
        rabbitmq.WithConsumeOptionsConcurrency(10),
        rabbitmq.WithConsumeOptionsQueueDurable,
        rabbitmq.WithConsumeOptionsQuorum,
    )
    handleError(err, "Start consuming", true)

Thanks!

wagslane commented 3 years ago

Thanks! v0.4.0 will solve this, the examples are also updated to include an exchange