Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bugfix-RND-458-consumre-last-messages-start-from-seq-not-working-as-expected #162

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -747,6 +747,10 @@ func handler(msgs []*memphis.Msg, err error, ctx context.Context) {
consumer.Consume(handler,
memphis.ConsumerPartitionKey(<string>) // use the partition key to consume from a spacific partition (if not specified consume in a Round Robin fashion)
)

consumer.Consume(handler,
memphis.ConsumerPartitionNumber(<string>)
)
```

#### Consumer schema deserialization
Expand Down Expand Up @@ -780,6 +784,7 @@ msgs, err := conn.FetchMessages("<station-name>", "<consumer-name>",
memphis.FetchStartConsumeFromSeq(<uint64>)// start consuming from a specific sequence. defaults to 1
memphis.FetchLastMessages(<int64>)// consume the last N messages, defaults to -1 (all messages in the station))
memphis.FetchPartitionKey(<string>)// use the partition key to consume from a spacific partition (if not specified consume in a Round Robin fashion)
)
```

### Fetch a single batch of messages after creating a consumer
Expand Down
2 changes: 1 addition & 1 deletion connect.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
package memphis

import (
"context"

Check failure on line 18 in connect.go

View workflow job for this annotation

GitHub Actions / run-broker-and-test

cannot find package "context" in any of:
"crypto/rand"
"crypto/tls"
"crypto/x509"
Expand All @@ -31,10 +31,10 @@
"sync"
"time"

"github.com/gofrs/uuid"

Check failure on line 34 in connect.go

View workflow job for this annotation

GitHub Actions / run-broker-and-test

cannot find package "github.com/gofrs/uuid" in any of:
"github.com/nats-io/nats.go"

Check failure on line 35 in connect.go

View workflow job for this annotation

GitHub Actions / run-broker-and-test

cannot find package "github.com/nats-io/nats.go" in any of:
"github.com/nats-io/nats.go/jetstream"

Check failure on line 36 in connect.go

View workflow job for this annotation

GitHub Actions / run-broker-and-test

cannot find package "github.com/nats-io/nats.go/jetstream" in any of:
"github.com/spaolacci/murmur3"

Check failure on line 37 in connect.go

View workflow job for this annotation

GitHub Actions / run-broker-and-test

cannot find package "github.com/spaolacci/murmur3" in any of:
)

const (
Expand Down Expand Up @@ -983,7 +983,7 @@
}

func (c *Conn) ValidatePartitionNumber(partitionNumber int, stationName string) error {
if partitionNumber < 0 || partitionNumber >= len(c.stationPartitions[stationName].PartitionsList) {
if partitionNumber < 0 || partitionNumber > len(c.stationPartitions[stationName].PartitionsList) {
return errors.New("Partition number is out of range")
}
for _, partition := range c.stationPartitions[stationName].PartitionsList {
Expand Down
Loading