Interface BroadcastPublisher

  • All Superinterfaces:

    public interface BroadcastPublisher
    extends Publisher

    This implementation of Publisher sends (broadcasts) updates to all connected peers regardless of whether they have requested (subscribed to) the subject. To obtain a BroadcastPublisher, call the appropriate method on the Caplin API


    In general, the use of broadcast messaging is not recommended, because it presents difficulties when handling failover of the DataSource application instance to another instance; the new DataSource instance does not know what data needs to be updated on the DataSource peers. However, broadcast messaging can be useful in situations where messages are transient and the data in them does not need to be always available to peers.

    • Method Detail

      • publishToPeer

        void publishToPeer​(Peer peer,
                           Message message)
      • publishSubjectErrorEvent

        void publishSubjectErrorEvent​(Peer peer,
                                      SubjectErrorEvent subjectErrorEvent)
        Publishes to the specified peer subscribed to a subject an event detailing an error in the subscription for that subject. Typically a DataProvider will use this to notify the remote peers that the data they are subscribed to is no longer available.
        peer - the peer to publish to.
        subjectErrorEvent - The error event to be published.
      • publishSubjectStatusEvent

        void publishSubjectStatusEvent​(Peer peer,
                                       SubjectStatusEvent subjectStatusEvent)
        Publishes to the specified peer an event about the change in status of a subject.
        peer - the peer to publish to.
        subjectStatusEvent - The subject status event to be published.