// Unmarshal unmarshals a message.
//nolint:gocritic
Unmarshal unmarshals a message.
nolint:gocritic
// Unmarshal unmarshals a message . // nolint : gocritic
func (d DefaultMarshaler) Unmarshal(amqpMsg amqp.Delivery) (*message.Message, error) {
	msgUUIDStr, err := d.unmarshalMessageUUID(amqpMsg.Headers)
	if err != nil {
		return nil, err
	}
	msg := message.NewMessage(msgUUIDStr, amqpMsg.Body)
	msg.Metadata = make(message.Metadata, len(amqpMsg.Headers)-1) 
	for key, value := range amqpMsg.Headers {
		if key == d.computeMessageUUIDHeaderKey() {
			continue
		}
		logger.Debugf("Metadata [%s] is of type: %s", key, reflect.TypeOf(value))
		msg.Metadata[key], err = marshalHeaderValue(value)
		if err != nil {
			return nil, fmt.Errorf("marshal header value for metadata [%s]: %w", key, err)
		}
	}
	return msg, nil
}
func ( d DefaultMarshaler ) Unmarshal ( amqpMsg amqp . Delivery ) ( * message . Message , error ) { msgUUIDStr , err := d . unmarshalMessageUUID ( amqpMsg . Headers ) if err != nil { return nil , err } msg := message . NewMessage ( msgUUIDStr , amqpMsg . Body ) msg . Metadata = make ( message . Metadata , len ( amqpMsg . Headers ) - 1 ) for key , value := range amqpMsg . Headers { if key == d . computeMessageUUIDHeaderKey ( ) { continue } logger . Debugf ( " " , key , reflect . TypeOf ( value ) ) msg . Metadata [ key ] , err = marshalHeaderValue ( value ) if err != nil { return nil , fmt . Errorf ( " " , key , err ) } } return msg , nil }
Unmarshal unmarshals a message.
Unmarshal unmarshals a message .
// headers - minus uuid