Although <https://developers.cloudflare.com/queues/configuration/javascript-apis/#messagesendrequest

Although https://developers.cloudflare.com/queues/configuration/javascript-apis/#messagesendrequest says that you can pass anything supported by the structuredClone algorithm, when I try to send a nodejs Buffer, it doesn't seem to work identical to structuredClone producer (worker a):
await env.QUEUE.send({
a: 'b',
nodejsBuffer: Buffer.from('whatever')
})
await env.QUEUE.send({
a: 'b',
nodejsBuffer: Buffer.from('whatever')
})
consumer (worker b):
for (const message of batch.messages) {
message.body.nodejsBuffer
// { type: 'Buffer', data: [0x77, 0x68, 0x61, 0x74, 0x65, 0x76, 0x65, 0x72] }
}
for (const message of batch.messages) {
message.body.nodejsBuffer
// { type: 'Buffer', data: [0x77, 0x68, 0x61, 0x74, 0x65, 0x76, 0x65, 0x72] }
}
while this isn't too big of an issue (I can easily do new Uint8Array(message.body.nodejsBuffer.data)), it would be nice if this was fixed. It took me a while to figure out what was causing issues
0 Replies
No replies yetBe the first to reply to this messageJoin

Did you find this page helpful?