Message Cowboy – Task Execution Status Reports and Periodic Cleanup

By | December 31, 2014

On the last day of 2014 I managed to squeeze in the final touches to storing task execution status entries and periodic cleanup of such entries in Message Cowboy.
For those not familiar with Message Cowboy, please refer to the Github project page.
Task execution status entries indicate the result of the execution of a periodic task in Message Cowboy, which can be one of the following:

  • Error
    An error occurred during the execution of the periodic task.
  • Success
    The periodic task was executed without errors and one or more messages were transferred.
  • No Message Received
    The periodic task was executed without errors but no messages were transferred.

All task execution status entries contain an optional status message and a timestamp that indicates when the schedule.d task was executed. As shown in the class diagram below, there is one different class for each of the status types, however, in the database they are all gathered in one and the same table. As of writing this article, the name of the table is “TaskExecutionStatuses”.

Task execution status class diagram.

Task execution status class diagram.

In the Message Cowboy configuration properties file, I have added a configuration property:

# Number of days to keep task execution status data.
TASK_EXECUTION_STATUS_DAYS_TO_KEEP=3

In addition there is a periodic task that will delete task execution status entries that have a task execution time that is older than the number of days configured in the above property.

In addition to the above, I have also created a repository on Travis CI for Message Cowboy. Travis CI will build Message Cowboy and run all the tests after each commit to Github and there is a build-status badge on the Github page that indicates the state of the latest build.
Travis CI is a new acquaintance of mine, but I like what I have seen so far.

Leave a Reply

Your email address will not be published. Required fields are marked *