Class EsbRealtimeBus

java.lang.Object
com.kingsrook.qqq.esb.realtime.EsbRealtimeBus
All Implemented Interfaces:
RealtimeBusInterface, AutoCloseable

public class EsbRealtimeBus extends Object implements RealtimeBusInterface, AutoCloseable
Non-durable, non-shared topic fan-out using the ESB provider connection manager.
  • Constructor Details

    • EsbRealtimeBus

      public EsbRealtimeBus()
      Code-reference constructor, initialized with the owning instance in context.
    • EsbRealtimeBus

      public EsbRealtimeBus(QInstance instance)
      Resolve a declared topic, or the default topic on a single configured provider.
  • Method Details

    • publish

      public void publish(RealtimeMessage message)
      Use a non-transacted, auto-ack session like the control topic. Never fail a caller.
      Specified by:
      publish in interface RealtimeBusInterface
    • subscribe

      public AutoCloseable subscribe(Consumer<RealtimeMessage> listener)
      Subscribe locally; the broker sends each message to every pod, including its producer.
      Specified by:
      subscribe in interface RealtimeBusInterface
    • isListening

      public boolean isListening()
      Readiness is also useful for hosts starting an HTTP server after the bus.
    • close

      public void close()
      Interrupt setup before taking its lock; the owner retains provider connections.
      Specified by:
      close in interface AutoCloseable