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

Fix the startMessageId can't be respected as the ChunkMessageID #209

Merged
merged 1 commit into from
Jun 22, 2022
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
9 changes: 8 additions & 1 deletion src/Pulsar.Client/Internal/ConsumerImpl.fs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,14 @@ type internal ConsumerImpl<'T> (consumerConfig: ConsumerConfiguration<'T>, clien
let subscribeTimeout = DateTime.Now.Add(clientConfig.OperationTimeout)
let mutable hasReachedEndOfTopic = false
let mutable avalablePermits = 0
let mutable startMessageId = startMessageId
let mutable startMessageId =
match startMessageId with
| Some startMsgId ->
match startMsgId.ChunkMessageIds with
| Some chunkMessageIds when chunkMessageIds.Length > 0 ->
Some(chunkMessageIds[0])
| _ -> Some(startMsgId)
| None -> None
let mutable lastMessageIdInBroker = MessageId.Earliest
let mutable lastDequeuedMessageId = MessageId.Earliest
let mutable duringSeek = None
Expand Down
11 changes: 11 additions & 0 deletions tests/IntegrationTests/Chunks.fs
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,17 @@ let tests =
Expect.equal "" msgIds.[i] msgAfterSeek.MessageId

do! consumer.UnsubscribeAsync()

let! (reader : IReader<byte[]>) =
client.NewReader()
.Topic(topicName)
.StartMessageIdInclusive()
.StartMessageId(msgIds.[1])
.CreateAsync()

let! (readMsg : Message<byte[]>) = reader.ReadNextAsync()
Expect.equal "" msgIds.[1] readMsg.MessageId

Log.Debug("Ended Seek chunk messages and receive correctly")
}
]