Save This Page
Home » activemq-parent-5.3.1-source-release » org.apache » activemq » broker » region » policy » [javadoc | source]
public interface: MessageQuery [javadoc | source] Represents some kind of query which will load initial messages from some source for a new topic subscriber.
Method from Summary:
execute,   validateUpdate
Method from Detail:
 public  void execute(ActiveMQDestination destination,
    MessageListener listener) throws Exception
    Executes the query for messages; each message is passed into the listener
 public boolean validateUpdate(Message message)
    Returns true if the given update is valid and does not overlap with the initial message query. When performing an initial load from some source, there is a chance that an update may occur which is logically before the message sent on the initial load - so this method provides a hook where the query instance can keep track of the version IDs of the messages sent so that if an older version is sent as an update it can be excluded to avoid going backwards in time. e.g. if the execute() method creates version 2 of an object and then an update message is sent for version 1, this method should return false to hide the old update message.