houseofcat / turbocookedrabbit

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

How to set the correlation ID? #26

Closed clalos closed 3 years ago

clalos commented 3 years ago

Hello, first of all thanks for the amazing work. I can't find a way to set the correlation ID of the underlying amqp.Publishing struct. It seems not supported by the configuration.

// Letter contains the message body and address of where things are going.
type Letter struct {
    LetterID   uuid.UUID
    RetryCount uint32
    Body       []byte
    Envelope   *Envelope
}

// Envelope contains all the address details of where a letter is going.
type Envelope struct {
    Exchange     string
    RoutingKey   string
    ContentType  string
    Mandatory    bool
    Immediate    bool
    Headers      amqp.Table
    DeliveryMode uint8
    Priority     uint8
}

--- Update It would be nice to set the amqp.Publishing.Type as well.

houseofcat commented 3 years ago

This was solved in release v2.1.4

Envelope struct supports two new fields CorrelationID and Type and are mapped to Publishing methods.

Details: https://github.com/houseofcat/turbocookedrabbit/pull/27