Class TransactionProcessor

  • All Implemented Interfaces:
    IServiceDefinitionAware, ITransactionProcessor

    public class TransactionProcessor
    extends CayenneService
    implements ITransactionProcessor, IServiceDefinitionAware
    Provides the default service of type "Transaction Processor". This implementation performs task expiry, submission abandonment, receipting and delivery in this order. For each step, the set of eligible submissions is calculated separately. Submissions may take part in multiple steps, e.g. receipting and then delivery. Each step can be turned off using service parameters, but this means submissions will not be processed, creating a backlog. Therefore, turning off a step should be used only for a short time when needed.
    Since:
    4.1.0
    • Constructor Detail

      • TransactionProcessor

        public TransactionProcessor()
    • Method Detail

      • processTransactions

        public void processTransactions()
        Process the list of transactions in the system, performing necessary steps such as abandonment, receipting and delivery in a meaningful sequence. Each step will operate only on the set of transactions eligible for it and commit its work before the next step starts.
        Specified by:
        processTransactions in interface ITransactionProcessor
        See Also:
        ITransactionProcessor.processTransactions()
      • setIncludeTaskExpiry

        @Deprecated
        public void setIncludeTaskExpiry​(boolean includeTaskExpiry)
        Deprecated.
        Obsolete in TM 18.5.0. Note: Turning off a processing step will cause a backlog. Use with caution and re-enable the step as soon as possible.
        Parameters:
        includeTaskExpiry - the new value of the includeTaskExpiry service parameter
      • setIncludeAbandonment

        public void setIncludeAbandonment​(boolean includeAbandonment)
        Set whether the transaction processor will perform submission abandonment. Note: Turning off a processing step will cause a backlog. Use with caution and re-enable the step as soon as possible.
        Parameters:
        includeAbandonment - the new value of the includeAbandonment service parameter
      • setIncludeDelivery

        public void setIncludeDelivery​(boolean includeDelivery)
        Set whether the transaction processor will perform delivery. Note: Turning off a processing step will cause a backlog. Use with caution and re-enable the step as soon as possible.
        Parameters:
        includeDelivery - the new value of the includeDelivery service parameter
      • isIncludeRESTDeliveryRetry

        public boolean isIncludeRESTDeliveryRetry()
        Specified by:
        isIncludeRESTDeliveryRetry in interface ITransactionProcessor
        Returns:
        whether the transaction processor will perform REST delivery retry.
        Since:
        4.1.8
      • setIncludeRESTDeliveryRetry

        public void setIncludeRESTDeliveryRetry​(boolean includeRESTDeliveryRetry)
        Set whether the transaction processor will perform REST delivery retry. Note: Turning off a processing step will cause a backlog. Use with caution and re-enable the step as soon as possible.
        Parameters:
        includeRESTDeliveryRetry - the new value of the includeDelivery service parameter
        Since:
        4.1.8
      • setIncludeTransactionHistory

        public void setIncludeTransactionHistory​(boolean transactionHistory)
        Set whether the transaction processor will will create transaction history records
        Parameters:
        transactionHistory - the new value of the transactionHistory service parameter
        Since:
        5.1.0
      • setIncludeDataRetention

        public void setIncludeDataRetention​(boolean includeDataRetention)
        Set whether the transaction processor will perform data retention.
        Parameters:
        includeDataRetention - the new value of the includeDataRetention service parameter
        Since:
        4.3.3
      • getFetchLimitForAbandonment

        public int getFetchLimitForAbandonment()
        Returns the fetch limit to use for submission abandonment. Note: Abandonment works on four different classes of submission. Each of them uses the fetch limit, so in theory the abandonment step may process up to 4xfetchLimitForAbandonment records
        Returns:
        the value of the fetchLimitForAbandonment service parameter
      • setFetchLimitForAbandonment

        public void setFetchLimitForAbandonment​(int fetchLimitForAbandonment)
        Set the fetch limit to use for submission abandonment. Note: Abandonment works on four different classes of submission. Each of them uses the fetch limit, so in theory the abandonment step may process up to 4xfetchLimitForAbandonment records
        Parameters:
        fetchLimitForAbandonment - the new value of the fetchLimitForAbandonment service parameter
      • getFetchLimitForDelivery

        public int getFetchLimitForDelivery()
        Returns the fetch limit to use for submission delivery.
        Returns:
        the value of the fetchLimitForDelivery service parameter
      • setFetchLimitForDelivery

        public void setFetchLimitForDelivery​(int fetchLimitForDelivery)
        Set the fetch limit to use for submission delivery.
        Parameters:
        fetchLimitForDelivery - the new value of the fetchLimitForDelivery service parameter
      • getFetchLimitForHistory

        public int getFetchLimitForHistory()
        Returns the fetch limit to use for transaction history creation
        Returns:
        the value of the fetchLimitForHistory service parameter
      • setFetchLimitForHistory

        public void setFetchLimitForHistory​(int fetchLimitForHistory)
        Set the fetch limit to use for transaction history creation
        Parameters:
        fetchLimitForHistory - the new value of the fetchLimitForHistory service parameter
      • getFetchLimitForTransactionPurging

        public int getFetchLimitForTransactionPurging()
        The maximum number of records to process for Transaction record purging
        Returns:
        the maximum number of records to process for Transaction record purging
        Since:
        4.3.3
      • setFetchLimitForTransactionPurging

        public void setFetchLimitForTransactionPurging​(int limit)
        The maximum number of records to process for Transaction record purging
        Parameters:
        limit - the maximum number of records to process for Transaction record purging
        Since:
        4.3.3
      • setLogToEventLog

        public void setLogToEventLog​(boolean value)
        Specify whether to log the results of the transaction processing to the event log.
        Specified by:
        setLogToEventLog in interface ITransactionProcessor
        Parameters:
        value - to specify whether to log the results of the transaction processing to the event log
        Since:
        4.3.3
      • getSystemAlertTimeMinutes

        public int getSystemAlertTimeMinutes()
        Returns the number of minutes that the system monitoring job will use when determining whether system alerts need to be raised about the transaction processing service. For example, if the transaction processing job has not run in the last n minutes (as determined by this setting) and is not paused, a system alert will be raised.
        Specified by:
        getSystemAlertTimeMinutes in interface ITransactionProcessor
        Returns:
        the number of minutes to use in system monitoring
        See Also:
        ITransactionProcessor.getSystemAlertTimeMinutes()
      • setSystemAlertTimeMinutes

        public void setSystemAlertTimeMinutes​(int systemAlertTimeMinutes)
        Set the number of minutes that the system monitoring job will use when determining whether system alerts need to be raised about the transaction processing service. For example, if the transaction processing job has not run in the last n minutes (as determined by this setting) and is not paused, a system alert will be raised.
        Parameters:
        systemAlertTimeMinutes - the new value of the systemAlertTimeMinutes service parameter
      • getMaxDataRetentionPeriod

        public int getMaxDataRetentionPeriod()
        Returns:
        the maximum data retention period in seconds to perform.
        Since:
        18.11.0
      • setMaxDataRetentionPeriod

        public void setMaxDataRetentionPeriod​(int maxDataRetentionPeriod)
        Set the maximum data retention period in seconds to perform.
        Parameters:
        maxDataRetentionPeriod - the maximum data retention period in seconds
        Since:
        18.11.0