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

How to publish message with Headers? #9

Closed xj-zh-dev closed 3 years ago

xj-zh-dev commented 3 years ago

How to publish message with Headers?

Like below: amqp.Publishing{ Headers: headers, ContentType: "text/plain", Body: data, },

xj-zh-dev commented 3 years ago

And how to publish messages with retries???

wagslane commented 3 years ago

Please see the Godoc: WithPublishOptionsHeaders

Retries are not a built-in functionality to the client - your application should handle them if you need them.

xj-zh-dev commented 3 years ago

Please see the Godoc: WithPublishOptionsHeaders

Retries are not a built-in functionality to the client - your application should handle them if you need them.

I download latest version, and use WithConsumeOptionsBindingExchangeName does not work well.