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
752 stars 126 forks source link

received 'direct' but current is 'topic'" #144

Closed fighterhit closed 8 months ago

fighterhit commented 8 months ago

I wrote a program with reference to examples/publisher but the following error is reported.

gorabbit ERROR: attempting to reconnect to amqp server after close with error: Exception (406) Reason: "PRECONDITION_FAILED - inequivalent arg 'type' for exchange 'xxx' in vhost 'yyy': received 'direct' but current is 'topic'"
fighterhit commented 8 months ago

Explicitly specify the topic mode to solve it.

rabbitmq.WithPublisherOptionsExchangeKind(amqp.ExchangeTopic)