YanshuoH opened a new issue, #1388:
URL: https://github.com/apache/pulsar-client-go/issues/1388

   #### Expected behavior
   
   In DLQ message, the `REAL_TOPIC` should be present.
   
   #### Actual behavior
   
   Now it is empty.
   
   #### Steps to reproduce
   
   Configure for example the MaxDeliveries to 1.
   Consume and call ReconsumeAfter twice.
   The message present in DLQ does have REAL_TOPIC property but it is empty.
   
   #### System configuration
   **Pulsar version**: v3.6.4
   **Pulsar-client-go version**: > v0.14.0 (tested version, historical tags 
were not tested)
   
   #### Additional Info
   
   After looking at the code of `ReconsumeLaterWithCustomProperties`
   I've found out that the constructed message is not affected with the `topic` 
props:
   ```
        reconsumeTimes := 1
        if s, ok := props[SysPropertyReconsumeTimes]; ok {
                reconsumeTimes, _ = strconv.Atoi(s)
                reconsumeTimes++
        } else {
                props[SysPropertyRealTopic] = msg.Topic()
                props[SysPropertyOriginMessageID] = msgID.messageID.String()
        }
        props[SysPropertyReconsumeTimes] = strconv.Itoa(reconsumeTimes)
        props[SysPropertyDelayTime] = fmt.Sprintf("%d", int64(delay)/1e6)
   
        consumerMsg := ConsumerMessage{
                Consumer: c,
                Message: &message{
                        payLoad:    msg.Payload(),
                        properties: props,
                        msgID:      msgID,
                },
        }
   
   ```
   
   That prop is used inside `dlq_router.run`:
   ```
                        // include original topic name of the message in 
properties
                        properties[SysPropertyRealTopic] = msg.Topic()
   ```
   
   That would explain the blank `REAL_TOPIC` value in dlq message.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to