未受監視
Microsoft 未監視的標記。
30 個問題
I am using Event Hub to store protobuf serialized message,
Everything is fine, If I am using SDK library (python or JS library) to access Event hub.
But when I use Azure function Eventhub trigger (when there is new message on event hub, trigger a function app to do the processing)
the message passed into the handler is actually a UTF-8 converted "string", and it contains fallback characters.
Because there are missing information, There is no way to convert it back to original binary (to do further protobuf parsing).
Please let me know if there are any configurations that I can make the "message" param of handler to be binary (like Buffer).
Thanks.
app.eventHub(`eventhub_trigger`, {
eventHubName: 'notification',
connection: 'CONN_STR',
cardinality: 'one',
handler: async (message: unknown, context: InvocationContext): Promise<void> => {
const value = message as string
console.log("------------------------------")
console.log(typeof message)
console.log(value.length)
console.log(Buffer.from(value, "latin1").toString("base64"))
console.log(Array.from(value, char => char.charCodeAt(0)))
// await processNotification(value)
}
})