Skip to content

Commit

Permalink
enable to specify the sequenceID (apache#62)
Browse files Browse the repository at this point in the history
enable to specify the sequenceID
  • Loading branch information
banishee authored and wolfstudy committed Sep 12, 2019
1 parent de147fa commit 11755b2
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pulsar/impl_partition_producer.go
Expand Up @@ -246,7 +246,12 @@ func (p *partitionProducer) internalSend(request *sendRequest) {
smm.Properties = internal.ConvertFromStringMap(msg.Properties)
}

sequenceID := internal.GetAndAdd(p.sequenceIDGenerator, 1)
var sequenceID uint64
if msg.SequenceID != nil {
sequenceID = uint64(*msg.SequenceID)
} else {
sequenceID = internal.GetAndAdd(p.sequenceIDGenerator, 1)
}

if sendAsBatch {
ok := p.batchBuilder.Add(smm, sequenceID, msg.Payload, request, msg.ReplicationClusters)
Expand Down

0 comments on commit 11755b2

Please sign in to comment.