Skip to content

Commit

Permalink
Add manual ID option
Browse files Browse the repository at this point in the history
Signed-off-by: Congqi Xia <[email protected]>
  • Loading branch information
congqixia committed May 8, 2024
1 parent 9f3b941 commit 4305e9d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions states/consume.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ type ConsumeParam struct {
Topic string `name:"topic" default:"" desc:"topic to consume"`
ShardName string `name:"shard_name" default:"" desc:"shard name(vchannel name) to filter with"`
Detail bool `name:"detail" default:"false" desc:"print msg detail"`
ManualID int64 `name:"manual_id" default:"0" desc"manual id"`
}

func (s *InstanceState) ConsumeCommand(ctx context.Context, p *ConsumeParam) error {
Expand All @@ -49,6 +50,8 @@ func (s *InstanceState) ConsumeCommand(ctx context.Context, p *ConsumeParam) err
messageID = kafka.DeserializeKafkaID(checkpoint.GetMsgID())
}
}
case "manual":
messageID = kafka.DeserializeKafkaID(kafka.SerializeKafkaID(p.ManualID))
default:
}

Expand Down

0 comments on commit 4305e9d

Please sign in to comment.