Skip to content

Commit

Permalink
Merge pull request #116 from kaytu-io/fix-query-map-param
Browse files Browse the repository at this point in the history
fix: receive sequence number after producing message
  • Loading branch information
artaasadi authored Sep 13, 2024
2 parents 4519f2a + 43aeeb6 commit 8c4a455
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions pkg/jq/nats.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,11 @@ func (jq *JobQueue) ConsumeWithConfig(
return consumeCtx, nil
}

func (jq *JobQueue) Produce(ctx context.Context, topic string, data []byte, id string) error {
if _, err := jq.js.Publish(ctx, topic, data, jetstream.WithMsgID(id)); err != nil {
return err
func (jq *JobQueue) Produce(ctx context.Context, topic string, data []byte, id string) (*uint64, error) {
pubAck, err := jq.js.Publish(ctx, topic, data, jetstream.WithMsgID(id))
if err != nil {
return nil, err
}

return nil
return &pubAck.Sequence, nil
}

0 comments on commit 8c4a455

Please sign in to comment.