You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2022/12/09 10:01:10 UTC

[GitHub] [pulsar-client-go] GPrabhudas commented on a diff in pull request #907: add messageId and topic as props of DLQ message

GPrabhudas commented on code in PR #907:
URL: https://github.com/apache/pulsar-client-go/pull/907#discussion_r1044282238


##########
pulsar/reader_test.go:
##########
@@ -430,6 +430,14 @@ func (id *myMessageID) PartitionIdx() int32 {
 	return id.PartitionIdx()
 }
 
+func (id *myMessageID) String() string {
+	mid, err := DeserializeMessageID(id.data)

Review Comment:
   ```go
   type myMessageID struct {
   	data []byte
   }
   
   func (id *myMessageID) Serialize() []byte {
   	return id.data
   }
   
   func (id *myMessageID) LedgerID() int64 {
   	return id.LedgerID()
   }
   
   func (id *myMessageID) EntryID() int64 {
   	return id.EntryID()
   }
   
   func (id *myMessageID) BatchIdx() int32 {
   	return id.BatchIdx()
   }
   
   func (id *myMessageID) PartitionIdx() int32 {
   	return id.PartitionIdx()
   }
   ```
   
   This is how ☝️ struct `myMessageID` implements interface `MessageID`. 
   
   If I use `return fmt.Sprintf("%d:%d:%d", id.LedgerID(), id.EntryID(), id.PartitionIdx())` it would result into `fatal error: stack overflow` due to infinite recursive calls



-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org