File tree Expand file tree Collapse file tree 1 file changed +18
-5
lines changed Expand file tree Collapse file tree 1 file changed +18
-5
lines changed Original file line number Diff line number Diff line change @@ -432,11 +432,12 @@ func (consumer *Consumer) QueryOffset() (int64, error) {
432
432
SetOffset constants
433
433
*/
434
434
const (
435
- typeFirst = int16 (1 )
436
- typeLast = int16 (2 )
437
- typeNext = int16 (3 )
438
- typeOffset = int16 (4 )
439
- typeTimestamp = int16 (5 )
435
+ typeFirst = int16 (1 )
436
+ typeLast = int16 (2 )
437
+ typeNext = int16 (3 )
438
+ typeOffset = int16 (4 )
439
+ typeTimestamp = int16 (5 )
440
+ // Deprecated: see LastConsumed()
440
441
typeLastConsumed = int16 (6 )
441
442
)
442
443
@@ -476,13 +477,25 @@ func (o OffsetSpecification) isOffset() bool {
476
477
return o .typeOfs == typeOffset || o .typeOfs == typeLastConsumed
477
478
}
478
479
480
+ // Deprecated: see LastConsumed()
479
481
func (o OffsetSpecification ) isLastConsumed () bool {
480
482
return o .typeOfs == typeLastConsumed
481
483
}
482
484
func (o OffsetSpecification ) isTimestamp () bool {
483
485
return o .typeOfs == typeTimestamp
484
486
}
485
487
488
+ // Deprecated: The method name may be misleading.
489
+ // The method does not indicate the last message consumed of the stream but the last stored offset.
490
+ // The method was added to help the user, but it created confusion.
491
+ // Use `QueryOffset` instead.:
492
+ //
493
+ // offset, err := env.QueryOffset(consumerName, streamName)
494
+ // // check the error
495
+ // ....
496
+ // SetOffset(stream.OffsetSpecification{}.Offset(offset)).
497
+ //
498
+ // So in this way it possible to start from the last offset stored and customize the behavior
486
499
func (o OffsetSpecification ) LastConsumed () OffsetSpecification {
487
500
o .typeOfs = typeLastConsumed
488
501
o .offset = - 1
You can’t perform that action at this time.
0 commit comments