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
DataSource.createBroadcastPublisher(com.caplin.datasource.namespace.Namespace)
method of DataSource
.
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.
Modifier and Type | Method and Description |
---|---|
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.
|
void |
publishSubjectStatusEvent(Peer peer,
SubjectStatusEvent subjectStatusEvent)
Publishes to the specified peer an event about the change in status of a subject.
|
void |
publishToPeer(Peer peer,
Message message) |
getMessageFactory, publishInitialMessage, publishMappingMessage, publishSubjectErrorEvent, publishSubjectStatusEvent, publishToSubscribedPeers
void publishSubjectErrorEvent(Peer peer, SubjectErrorEvent subjectErrorEvent)
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.void publishSubjectStatusEvent(Peer peer, SubjectStatusEvent subjectStatusEvent)
peer
- the peer to publish to.subjectStatusEvent
- The subject status event to be published.Please send bug reports and comments to Caplin support