houseofcat / turbocookedrabbit

A user friendly RabbitMQ library written in Golang.
MIT License
107 stars 20 forks source link

Can you return Header in Message struct? #5

Closed dfelici87 closed 4 years ago

dfelici87 commented 4 years ago

Hello,

Great library!!! I need to read the header of message that i received in a queue(for dead letter exchange into the message header rabbitmq write some util information).

Can you add a message Header in models.Message struct? example : type Message struct { IsAckable bool Headers amqp.Table Body []byte deliveryTag uint64 amqpChan *amqp.Channel }

Thanks in advance.

houseofcat commented 4 years ago

Absolutely, will get to it asap.

houseofcat commented 4 years ago

You should be good to go in v2.0.2.

Letter headers should have been publishing but added RabbitService generic publishes to support headers fields.

Consumers are now persisting Headers and providing access to them in ReceivedMessage structs. I will close this issue in the next day or two unless you obviously have a problem with the headers.