Skip to content

Commit 32fc0d7

Browse files
committed
Add manual commit
Signed-off-by: Gabriele Santomaggio <g.santomaggio@gmail.com>
1 parent a6350ec commit 32fc0d7

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -573,13 +573,13 @@ Super Stream supports [publish-filtering](#publish-filtering) and [consume-filte
573573
Offset tracking is supported for the Super Stream consumer. </br>
574574
In the same way as the standard stream, you can use the `SetAutoCommit` or `SetManualCommit` option to enable/disable the automatic offset tracking. </br>
575575
576-
On the super stream consumer message handler is possible to identify the partition, the consumer and the offset. </br>:
576+
On the super stream consumer message handler is possible to identify the partition, the consumer and the offset: </br>
577577
```golang
578578
handleMessages := func(consumerContext stream.ConsumerContext, message *amqp.Message) {
579579
....
580-
consumerContext.Consumer.GetName()
581-
consumerContext.Consumer.GetOffset()
582-
consumerContext.Consumer.GetStreamName()
580+
consumerContext.Consumer.GetName() // consumer name
581+
consumerContext.Consumer.GetOffset() // current offset
582+
consumerContext.Consumer.GetStreamName() // stream name (partition name )
583583
....
584584
}
585585
```
@@ -588,6 +588,7 @@ Manual tracking API:
588588
- `consumerContext.Consumer.StoreOffset()`: stores the current offset.
589589
- `consumerContext.Consumer.StoreCustomOffset(xxx)` stores a custom offset.
590590
591+
Like the standard stream, you should avoid to store the offset for each single message: it will reduce the performances.
591592
592593
593594
### Performance test tool

0 commit comments

Comments
 (0)