In our customized Openfire setup, we have a consumer that maintains a WebSocket connection pool with Openfire, consisting of 100 connections for further processing.
Architecture Details:
The client maintains a WebSocket connection through Openfire (3) via an HTTP Load Balancer (1) and Nginx (2).
When the sender and receiver exchange packets for communication:
- The packet first reaches Openfire (3).
- Openfire then publishes this packet to the Node Kafka topic (4).
- From this topic, WsWrite (5) consumes the packet and pushes it to the corresponding Kafka topic.
- WsWrite maintains a WebSocket connection pool and writes the packet over the established WebSocket connection.
- Finally, the packet reaches Openfire (3) again, where it checks if the receiver’s WebSocket connection is active.
- If the connection exists, Openfire delivers the packet over the WebSocket connection to the receiver.
504 Incident: After restarting our ws_writer consumers(5), we encountered a 504 error code from Nginx (2). Correspondingly, Openfire’s(3) debug logs displayed the following messages:
- Error: “Error detected; session”
- Warning: “Closing session due to incorrect stream header”