mqtt-ingest draft

This commit is contained in:
Nikita Bizyaev
2026-06-04 14:40:18 +03:00
commit e7b44539ae
27 changed files with 1492 additions and 0 deletions

19
app/src/router.ts Normal file
View File

@@ -0,0 +1,19 @@
import { getHandler } from './registry.js'
export async function routeMessage(
topic: string,
payload: Buffer,
): Promise<void> {
const handler = getHandler(topic)
if (!handler) {
console.warn('mqtt.unhandled_topic', { topic })
return
}
try {
await handler(topic, payload)
} catch (err) {
console.error('mqtt.handler_error', { topic, err })
}
}