Skip to content

feat(DATAGO-126454): Add network dev broker for remote tool communication#131

Open
efunneko wants to merge 6 commits into
mainfrom
ed/remote-dev-broker
Open

feat(DATAGO-126454): Add network dev broker for remote tool communication#131
efunneko wants to merge 6 commits into
mainfrom
ed/remote-dev-broker

Conversation

@efunneko

@efunneko efunneko commented Feb 25, 2026

Copy link
Copy Markdown
Collaborator

What is the purpose of this change?

Add TCP networking support to the dev broker, enabling remote tools and processes (e.g., Docker containers) to communicate with a running SAM instance over the network. This is needed to support remote tools that need to interact with SAM's message broker but are not running in the same process.

How was this change implemented?

New modules:

  • dev_broker_protocol.py — JSON-over-TCP protocol definitions (newline-delimited JSON) with command types, response statuses, and error codes
  • dev_broker_server.py — Async TCP server exposing DevBroker functionality over the network, managing client sessions, subscriptions, and message queues
  • network_dev_broker.py — Network-based DevBroker client implementing the Messaging interface as a drop-in replacement for the in-process DevBroker

Modified modules:

  • dev_broker_messaging.py — Added network server support and message forwarding to network clients
  • messaging_builder.py — Added support for creating network dev broker instances
  • broker_base.py / broker_input.py — Updated to support the new messaging type
  • app.py — Integration of dev broker server startup

Key Design Decisions

  • Uses a JSON-over-TCP (newline-delimited) protocol for simplicity and debuggability
  • The NetworkDevBroker client supports automatic reconnection with subscription re-establishment when the server restarts or the connection drops
  • The server can integrate with a local DevBroker instance to share messages between local and network clients
  • Publishers do not receive their own messages to prevent echo loops

How was this change tested?

  • Unit tests: 54 tests covering protocol encoding/decoding, server lifecycle, message routing, wildcard subscriptions, client connect/disconnect/reconnect, error handling, and bytes payload handling
  • All tests pass locally

Is there anything the reviewers should focus on?

  • The reconnection logic in NetworkDevBroker — ensure the retry/backoff behavior is appropriate
  • Thread safety of the client's _send_command method (uses a threading lock)
  • The server's readline limit increase to 10MB for large payloads

Jira: DATAGO-126454

Add comprehensive tests for the network dev broker TCP protocol,
server, and client covering protocol encoding/decoding, server
lifecycle, message routing, wildcard subscriptions, and client
connect/disconnect/reconnect behavior.
@sonarqube-solacecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant