Skip to content

Message bus replacement service #1326

Open

Description

@tpoliaw

The server and client currently communicate via both HTTP/rest and an external message bus. This adds a fair amount of complexity, especially around the submission of tasks where two requests are required separated by subscription to the message bus and the task worker has to keep track of multiple submitted but unstarted tasks.

A simpler approach could be to use a long lived HTTP connection that streams the events directly to the client. This could potentially be gRPC or websockets (or something else?).

We would then be left with a single run_plan(name, args) endpoint and could remove submit_task, delete_submitted_task, get_tasks, set_active_task and get_task.

This could also enable us to support aborting plans if the client exits (eg Ctrl-C from the terminal aborts the plan) or pausing and resuming a plan within the same process.

Activity

  1. DominicOram commented on Jan 28, 2026

    @DominicOram
    Contributor

    A simpler approach could be to use a long lived HTTP connection that streams the events directly to the client.

    I assume the events will also be streamed elsewhere so that external services can monitor them and e.g. trigger processing?

  2. tpoliaw commented on Jan 28, 2026

    @tpoliaw
    ContributorAuthor

    There are no plans/designs yet but I can't see why not.

    I imagine events could still be broadcast on a message bus (maybe skipping the progress events?). Alternatively there could be a listen endpoint could be included that allows a direct connection to monitor events. Or some kind of webhooks could be configured so that eg start/stop events could be sent to specific services.

  3. DominicOram commented on Jan 28, 2026

    @DominicOram
    Contributor

    Ok, I would just say that if you're going to change this then it would be good to give very widespread notice. We're currently starting to use that message bus in quite a few places.

  4. tpoliaw commented on Jan 28, 2026

    @tpoliaw
    ContributorAuthor

    Sure, we'll make sure people are aware of changes and have a chance to give feedback on ideas. I imagine this would become a blueapi v2 if it goes ahead.

  5. added this to the Blueapi 2.0.0 milestone on Jan 28, 2026
  6. abbiemery commented on Feb 26, 2026

    @abbiemery
    Contributor

    See also #1415 and initial WIP in #1413

  7. added
    c: rest api
    c: messaging
    enhancement
    external
    on Feb 26, 2026
  8. fajinyuan commented on Mar 6, 2026

    @fajinyuan
    Contributor

    Does your proposal (websocket) here continue to support multiple clients running or monitor experiment data collection process required by collaborating scientists from different locations?

  9. tpoliaw commented on Mar 6, 2026

    @tpoliaw
    ContributorAuthor

    There should be no change in behaviour for who can run a plan or when as part of this change. The main motivation is to remove the need for running a plan to be a three-step process, reducing the complexity of both the client and the server. It should also allow web clients to monitor the plans they submit more easily as they can natively connect to websockets but not the message bus.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    c: messagingc: rest apienhancementexternal

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions