psdi.iface.mic

Class DBMsgTracker

  • java.lang.Object
    • psdi.iface.mic.DBMsgTracker
  • All Implemented Interfaces:
    MessageTracker


    public class DBMsgTracker
    extends java.lang.Object
    implements MessageTracker
    Performs message tracking using JDBC. This class will never throw an exception back but just log it because we don't want next objects in hierarchy of transaction object to get affected by the tracking exception. This is very rare case though such as momentary loss of network connection etc.
    • Constructor Summary

      Constructors 
      Constructor and Description
      DBMsgTracker() 
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      boolean rollbackTrackingLog(java.lang.String messageId) 
      boolean trackMessage(java.util.Map msgProperties)
      Perform Message Tracking with Implicit commit.
      boolean trackMessage(java.util.Map msgProperties, byte[] data)
      Perform Message Tracking with Implicit commit.
      boolean trackMessage(java.util.Map msgProperties, byte[] data, java.sql.Connection conn)
      Perform Message Tracking without commit.
      boolean trackMessage(java.util.Map msgProperties, java.sql.Connection conn)
      Perform Message Tracking without commit.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DBMsgTracker

        public DBMsgTracker()
    • Method Detail

      • trackMessage

        public boolean trackMessage(java.util.Map msgProperties,
                                    byte[] data)
        Perform Message Tracking with Implicit commit. Typically needed by message producer in order to store original message data. e.g. MEAQueueProcessor
        Specified by:
        trackMessage in interface MessageTracker
        Parameters:
        properties - Message Properties needed for tracking
        data - Original Message data
        Returns:
        true if Message was tracked. False would result when tracking is not enabled.
        Throws:
        MXException
      • trackMessage

        public boolean trackMessage(java.util.Map msgProperties)
        Perform Message Tracking with Implicit commit. Typically needed by message consumer to update the existing tracking info for a given message. e.g. JMSQueueCronTask
        Specified by:
        trackMessage in interface MessageTracker
        Parameters:
        properties - Message Properties needed for tracking
        Returns:
        true if Message was tracked. False would result when tracking is not enabled.
        Throws:
        MXException
      • trackMessage

        public boolean trackMessage(java.util.Map msgProperties,
                                    java.sql.Connection conn)
        Perform Message Tracking without commit. Typically needed by message consumer to update the existing tracking info for a given message and consumer assumes the commit resposibility. This method is called internally within the class and currently there is no good example of this where in application logic this might be needed.
        Specified by:
        trackMessage in interface MessageTracker
        Parameters:
        properties - Message Properties needed for tracking
        conn - Database connection to be used by tracking logic
        Returns:
        true if Message was tracked. False would result when tracking is not enabled.
        Throws:
        MXException
      • trackMessage

        public boolean trackMessage(java.util.Map msgProperties,
                                    byte[] data,
                                    java.sql.Connection conn)
        Perform Message Tracking without commit. It is the responsibility of client to commit An example would be file load (FileLoaderProcess) when all messages are tracked as they are getting saved in JMS Queue and only one final commit is done at JMS transaction to ensure either all go in or none. Typically needed by message producer in order to store original message data when producer needs to perform commit itself.
        Specified by:
        trackMessage in interface MessageTracker
        Parameters:
        properties - Message Properties needed for tracking
        data - Original Message data
        conn - Database connection to be used by tracking logic
        Returns:
        true if Message was tracked. False would result when tracking is not enabled.
        Throws:
        MXException