Package org.apache.juneau.console.bus


package org.apache.juneau.console.bus
Server half of the console message bus.

A ServerBus holds retained topic values and the sessions that bridge them to pages; a BusPolicy says what may flow, in which direction, to whom (everything else is denied); BusEventsMixin exposes the CSRF-guarded session POST and the capability-gated SSE stream on a REST resource. The WebSocket transport is the separate juneau-console-bus-websocket module.

Example:

@Rest(path="/ops/jobs") public class JobsRest extends BasicRestServlet implements BusEventsMixin { static final ServerBus BUS = ServerBus.create(BusPolicy.create() .downstream("ops.jobs", true).build()); @Override public ServerBus serverBus() { return BUS; } } // Anywhere in the application: JobsRest.BUS.publish("ops.jobs", JsonMap.of("schemaVersion", 1, "running", running));

Since:
10.0.0