Package net.sf.eBus.feed.historic

This package contains a specialized feed providing notification feeds which support both historic and live messages. This capability is provided by two feeds: historic publish feed and historic subscribe feed.

Historic Publish Feed

Like IEPublishFeed, this feed posts live notification messages to eBus if there are any live subscribers listening. The value-added difference is that the historic publish feed persists notifications using the configured IEMessageStore instance. Likewise, the historic publish feed also opens and advertises a request feed for historic request messages. When an historic request is received, the historic notification feed uses IEMessageStore.retrieve(EInterval) method to extract the historic notification messages which are sent back via historic reply messages.

Objects needing to use an historic notification feed must implement IEHistoricPublisher interface. Unlike an EPublisher which should not post notification messages when there are no active subscribers, an historic publisher is clear to post notifications on an open, advertised, and up publish status historic feed because of the need to persist messages.

Historic Subscribe Feed

This feed retrieve both historic and live notification messages and present them as a single continuous stream back to the IEHistoricSubscriber. These notification messages are ordered by timestamp (millisecond granularity), publisher identifier, and message position. For this reason it is important that historic publishers be assigned a unique identifier and that messages be assigned a unique position (especially if messages are posted at a sub-millisecond rate).

Unless the historic subscribe feed is configured to accept notification messages indefinitely, the historic subscriber is informed that the underlying feed has terminated when IEHistoricSubscriber.feedDone() method is called. Once called, this means that the historic subscriber will no longer receive updates.

Another difference between historic and live feeds is that historic subscriber is informed of individual publisher feed status via its feedStatus method. This allows the historic subscriber to determine if there was or is a break in an individual publisher's stream. The feedStatus() method is called for both past and live publisher status updates.