Interface UpstreamHandler

All Known Implementing Classes:
TerminalInput
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

Handles one upstream topic (page → server, WebSocket bridges only). Runs on the container's WebSocket thread; keep it short or hand off. An exception is logged and answered with a generic bus:upstream-failed frame.
Example:

UpstreamHandler cancelAll = (session, topic, payload) -> { jobs.running().forEach(AsyncJob::cancel); }; BusPolicy.create().upstream("ops.cancel-all", cancelAll);

Since:
10.0.0
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    handle(BusSession session, String topic, JsonMap payload)
    Handles one upstream publish.
  • Method Details

    • handle

      void handle(BusSession session, String topic, JsonMap payload) throws Exception
      Handles one upstream publish.
      Parameters:
      session - The session that sent it. Never null.
      topic - The topic, already checked against the session's upstream grant.
      payload - The JSON-object payload. Never null.
      Throws:
      Exception - Any failure; it is logged and never crosses the wire.