How prabhath-wijewardhana/nodejs-socket-msg-to-rabbitmq works
This repository contains Node.js TCP ingestion variants for GPS-device messages. The main workflow in app3.js accepts GT06 connections, associates login IDs with sockets, parses location/status packets, acknowledges logins, and forwards telemetry to RabbitMQ while persisting location records in MySQL. app.js is a simpler direct-to-MySQL variant; app2.js relays unparsed TCP data to RabbitMQ. The graph follows the sampled implementations; app3.js has omitted sections, so only visible or documented relationships are shown.
Main entry points: app3.js GT06 server · app.js Login and location handlers · app2.js Raw TCP relay
Components 14
Device ingestion
- GT06 server
app3.js - Device sessions
app3.js - Direct TCP server
app.js - Raw TCP relay
app2.js
Packet processing
- Login parser
app3.js - Login response
app3.js - Location parser
app3.js - Status parser
app3.js - Login and location handlers
app.js - Direct packet parsing
app.js
Data delivery
- Telemetry dispatch
app3.js - RabbitMQ queue
- MySQL location store
Other components
- GPS tracker
Connections 15
- GPS tracker → GT06 server: sends packets
app3.js - GT06 server → Login parser: parses login
app3.js - GT06 server → Device sessions: stores device ID
app3.js - GT06 server → Login response: sends response
app3.js - GT06 server → Location parser: parses location
app3.js - GT06 server → Status parser: parses status
app3.js - GT06 server → Telemetry dispatch: forwards telemetry
app3.js - Telemetry dispatch → RabbitMQ queue: publishes messages
app3.js - Telemetry dispatch → MySQL location store: inserts locations
app3.js - GPS tracker → Direct TCP server: sends packets
app.js - Direct TCP server → Login and location handlers: dispatches packets
app.js - Login and location handlers → Direct packet parsing: parses messages
app.js - Login and location handlers → MySQL location store: saves locations
app.js - GPS tracker → Raw TCP relay: sends data
app2.js - Raw TCP relay → RabbitMQ queue: relays raw data
app2.js