Skip to content

Feature: Add WebSocket support to HTTP Adapter #2800

@arvindh123

Description

@arvindh123

Background

Currently, we have two separate adapter services:

  • HTTP Adapter: Responsible for posting messages.
  • WebSocket Adapter: Responsible for subscribing to messages via WebSocket.

Since WebSocket is a protocol upgrade over HTTP, it is technically feasible to support both HTTP and WebSocket in a single service. This would simplify the architecture and reduce deployment overhead.

Goal

Merge WebSocket functionality into the existing HTTP adapter, allowing it to handle both:

  • HTTP POST requests for publishing messages (existing functionality)
  • WebSocket connections for subscribing to messages

Approach

We can achieve this by reusing the WebSocket handling logic from the existing WebSocket adapter and integrating it into the HTTP adapter service.

  • Copy WebSocket-related code from the WebSocket adapter to the HTTP adapter.
  • Add support for HTTP Upgrade requests (Connection: Upgrade and Upgrade: websocket) in the HTTP adapter.
  • Ensure WebSocket clients can subscribe to topics just as they do with the standalone WebSocket adapter.

Benefits

  • Reduced number of deployed services
  • Simplified configuration and maintenance
  • Unified endpoint for both publishing and subscribing

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Status

🩺 Review and testing

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions