-
Notifications
You must be signed in to change notification settings - Fork 11
Open
Description
When a message has an empty body, it waits for the body frame forever (which is never sent by the broker). So we should return as early as we get the header with the bodySize being 0.
Test code to reproduce the issue:
func testBasicGetWithZeroBytesPayload() async throws {
let channel = try await connection.openChannel()
try await channel.queueDeclare(name: "test", durable: true)
let body = ByteBufferAllocator().buffer(string: "")
try await channel.basicPublish(from: body, exchange: "", routingKey: "test")
guard let msg = try await channel.basicGet(queue: "test") else {
return XCTFail()
}
XCTAssertEqual(msg.messageCount, 0)
XCTAssertEqual(msg.message.body.getString(at: 0, length: msg.message.body.readableBytes), "")
try await channel.queueDelete(name: "test")
try await channel.close()
}
Same as guimauvedigital/kourier#9
Metadata
Metadata
Assignees
Labels
No labels