subscribeWithHistory method
Get the historical messages for one or more subjects, if any, then subscribe to those subjects.
Attempt to get the number of historical messages as defined by the argument \c numberOfHistoricalMessages, for each subject in the argument \c subjects, then subscribe to than subject.
When Guaranteed Message Delivery is enabled, each MigratoryData server of the cluster maintains an in-memory cache with historical messages for each subject. The cache of each subject is available in all servers of the cluster. The maximum number of messages held in cache is defined by the parameter \c MaxCachedMessagesPerSubject of the MigratoryData server which defaults to 1,000 messages. The historical messages are continuously removed from the cache, but it is guaranteed that they are available in the cache at least the number of seconds defined by the parameter \c CacheExpireTime which defaults to \c 180 seconds.
Note: If the value of \c numberOfHistoricalMessages is higher than the number of historical messages available in the cache, then the client will receive only the messages available in the cache. As a consequence, if you use a value higher than the value of the value of the parameter \c MaxCachedMessagesPerSubject of the MigratoryData server (which defaults to 1000), then you will get the entire cache before subscribing to the subjects specified with this API method.
If the value of \c numberOfHistoricalMessages is \c 0, then this API method is equivalent to the API
method \link MigratoryDataClient.subscribe() \endlink.
\param subjects subjects to subscribe \param numberOfHistoricalMessages the number of historical messages to be retrieved from the cache of the server
Implementation
subscribeWithHistory(List<String> subjects, int numberOfHistoricalMessages) {
clientImpl.subscribe(subjects, numberOfHistoricalMessages);
}