Class EsbClusterBus

java.lang.Object
com.kingsrook.qqq.esb.cluster.EsbClusterBus
All Implemented Interfaces:
ClusterBusInterface, AutoCloseable

public class EsbClusterBus extends Object implements ClusterBusInterface, AutoCloseable
Cluster control events (core ClusterBus) over an ESB topic, qqq.cluster.control: every node publishes and subscribes (non-durable, non-shared, so each node gets each event; non-persistent with a 2 minute time-to-live - a lost event is covered by cache TTLs). Configure with ClusterBusMetaData.withBus(new QCodeReference(EsbClusterBus.class)). The topic is declared automatically when the instance has a single ESB provider; with several, declare it (type TOPIC) with its provider.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    the topic every node publishes and subscribes to
  • Constructor Summary

    Constructors
    Constructor
    Description
    Code-reference constructor, initialized with the owning instance in context.
    Resolve a declared topic, or the default topic on a single configured provider.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Interrupt setup before taking its lock; the owner retains provider connections.
    boolean
    Readiness is also useful for hosts starting an HTTP server after the bus.
    void
    Use a non-transacted, auto-ack session like the control topic.
    Subscribe locally; the broker sends each message to every pod, including its producer.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • DESTINATION_NAME

      public static final String DESTINATION_NAME
      the topic every node publishes and subscribes to
      See Also:
  • Constructor Details

    • EsbClusterBus

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

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

    • publish

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

      public AutoCloseable subscribe(Consumer<ClusterEvent> listener)
      Subscribe locally; the broker sends each message to every pod, including its producer.
      Specified by:
      subscribe in interface ClusterBusInterface
    • 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