Extracting message ID on solace pub sub broker in golang API

Hello everyone, currently I am researching Solace GoLang Api and I have few questions. Can you please help me because I cannot find the answer.
How can I extract message ID or is there any unique ID that can be extracted from Inbound message and used for distinguishing messaged published to message broker I would also like to know how to set sequence number on publisher side. Right now I am using GetSequenceNumber() method and can’t get anything but 0 because it is not set on publisher side.


Tnx for help in advance

Hi @lukamacan , thanks for the question,
There are a couple different message IDs on any given message. There is the Message ID which is simply an incrementing count of message delivery, but does not uniquely identify a message. This is not available in the Go API. There is the Replication Group Message ID which is guaranteed to be unique within a replication group and should be used when uniquely identifying a message. See GetReplicationGroupMessageID on message package - solace.dev/go/messaging/pkg/solace/message - Go Packages . If you are using a Go API publisher, you can use the OutboundMessageBuilder from MessagingService.MessageBuilder() , in particular WithSequenceNumber on solace package - solace.dev/go/messaging/pkg/solace - Go Packages . Hope that helps!

Thank you a lot :wink: It helps a lot