Class DMQManager


  • public class DMQManager
    extends Object
    The DMQManager is made to stock the dead messages before sending them to the dead message queue, only if such a queue is defined.
    • Field Detail

      • logger

        private static final Logger logger
      • DEBUG

        private static final boolean DEBUG
      • destDmqId

        private AgentId destDmqId
      • senderId

        private AgentId senderId
    • Constructor Detail

      • DMQManager

        public DMQManager​(AgentId specificDmq,
                          AgentId currentDestDmq,
                          AgentId senderId)
        Creates a DMQManager. The specificDmq is used in priority. If null, destination DMQ is used if it exists, else default DMQ is used. If none exists, dead messages will be lost.
        Parameters:
        specificDmq - Identifier of the dead message queue to use in priority.
        currentDestDmq - The DMQ of the destination
        senderId - The id of the destination. This is used to avoid sending to itself.
      • DMQManager

        public DMQManager​(AgentId currentDestDmq,
                          AgentId senderId)
        Creates a DMQManager. Destination DMQ is used if it exists, else default DMQ is used. If none exists, dead messages will be lost
        Parameters:
        currentDestDmq - The DMQ of the destination
        senderId - The id of the destination. This is used to avoid sending to itself.
    • Method Detail

      • addDeadMessage

        public void addDeadMessage​(Message mess,
                                   short reason)
        Stocks a dead message waiting to be sent to the DMQ. If no DMQ was found at creation time, the message is lost.
        Parameters:
        mess - The message to stock
        reason - The reason explaining why the message has to be send to the DMQ. It can be one of the following: EXPIRED, NOT_WRITEABLE, UNDELIVERABLE, ADMIN_DELETED, DELETED_DEST, QUEUE_FULL or UNEXPECTED_ERROR.
      • sendToDMQ

        public void sendToDMQ()
        Sends previously stocked messages to the appropriate DMQ.