Package com.caplin.datasource.publisher
Interface BroadcastPublisher
- All Superinterfaces:
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 Summary
Modifier and TypeMethodDescriptionvoidpublishSubjectErrorEvent(Peer peer, SubjectErrorEvent subjectErrorEvent) Publishes to the specified peer subscribed to a subject an event detailing an error in the subscription for that subject.voidpublishSubjectStatusEvent(Peer peer, SubjectStatusEvent subjectStatusEvent) Publishes to the specified peer an event about the change in status of a subject.voidpublishToPeer(Peer peer, Message message) Methods inherited from interface com.caplin.datasource.publisher.Publisher
getMessageFactory, publishInitialMessage, publishMappingMessage, publishSubjectErrorEvent, publishSubjectStatusEvent, publishToSubscribedPeers
-
Method Details
-
publishToPeer
-
publishSubjectErrorEvent
Publishes to the specified peer subscribed to a subject an event detailing an error in the subscription for that subject. Typically aDataProviderwill use this to notify the remote peers that the data they are subscribed to is no longer available.- Parameters:
peer- the peer to publish to.subjectErrorEvent- The error event to be published.
-
publishSubjectStatusEvent
Publishes to the specified peer an event about the change in status of a subject.- Parameters:
peer- the peer to publish to.subjectStatusEvent- The subject status event to be published.
-