Class DistributionQueue

    • Field Detail

      • logger

        private static final Logger logger
      • DEBUG

        private static final boolean DEBUG
      • DEFAULT_PERIOD

        public static final long DEFAULT_PERIOD
        Default period used to clean queue and re-distribute failing messages.
        See Also:
        Constant Field Values
      • serialVersionUID

        private static final long serialVersionUID
        define serialVersionUID for interoperability
        See Also:
        Constant Field Values
      • distributionClassName

        private String distributionClassName
        The acquisition class name.
      • batchDistribution

        private boolean batchDistribution
        Tells if we try to distribute the each message each time (true) or if the distribution is stopped on first error (false). Batch mode can (and will probably) lose message ordering but will not stop deliverable messages in the queue waiting for previous ones to be sent.
      • isAsyncDistribution

        private boolean isAsyncDistribution
        Tells if daemon distribution is active. On true, the batchDistribution is set.
      • nbMsgsReceiveSinceCreation

        protected long nbMsgsReceiveSinceCreation
    • Constructor Detail

      • DistributionQueue

        public DistributionQueue()
    • Method Detail

      • isAsyncDistribution

        private boolean isAsyncDistribution​(Properties properties)
      • initialize

        public void initialize​(boolean firstTime)
                        throws Exception
        Description copied from class: Queue
        Initializes the destination.
        Overrides:
        initialize in class Queue
        Parameters:
        firstTime - true when first called by the factory
        Throws:
        Exception
      • agentFinalize

        public void agentFinalize​(boolean lastTime)
        Description copied from class: Destination
        Finalizes the agent before it is garbaged.
        Overrides:
        agentFinalize in class Destination
        Parameters:
        lastTime - true if the destination is deleted
      • getNbMsgsDeliverSinceCreation

        public final long getNbMsgsDeliverSinceCreation()
        Description copied from class: Destination
        Returns the number of messages delivered since creation time of this destination. It includes messages all delivered messages to a consumer, already acknowledged or not.
        Specified by:
        getNbMsgsDeliverSinceCreation in interface DestinationMBean
        Overrides:
        getNbMsgsDeliverSinceCreation in class Queue
        Returns:
        the number of messages delivered since creation time.
      • preProcess

        public ClientMessages preProcess​(AgentId from,
                                         ClientMessages cm)
        Description copied from class: Destination
        This method is needed to add processing before the standard handling. It is used in subclass of Queue and Topic. The incoming messages can be modified or deleted during the processing.
        Overrides:
        preProcess in class Destination
        Parameters:
        from - The sender of the message
        cm - The incoming messages.
        Returns:
        The incoming messages after processing.
      • removeAndDeleteMessages

        private void removeAndDeleteMessages()
      • removeAndDeleteMessage

        private void removeAndDeleteMessage​(String id)
      • postProcess

        protected void postProcess​(ClientMessages cm)
        Description copied from class: Destination
        This method is needed to add processing after the standard handling. It is used in subclass of Queue and Topic. The incoming messages can be modified or deleted during the processing.
        Overrides:
        postProcess in class Destination
        Parameters:
        cm - The incoming messages.
      • wakeUpNot

        public void wakeUpNot​(WakeUpNot not)
        wake up, and cleans the queue.
        Overrides:
        wakeUpNot in class Queue