bc-serverservice status JDBC

This is a status service that stores jobs status and output in a JDBC compatible database. BeyondCron is distributed with support for MySQL and PostgreSQL databases. With the inclusion of the the appropriate JDBC driver, and creation of the the required table, BeyondCron is able to support other databases.

Configuration variables

The following configuration variables can be defined using the config set command. One set, the service can be loaded/reloaded using the status service reload command.

beyondcron.status.service JDBC
jdbc.url Database connection URL.
jdbc.user Database user name.
jdbc.password Database user password.
jdbc.table.status Name of table to save the status and output of each job in.
jdbc.… Optional MySQL configuration properties.
beyondcron.status.service JDBC
jdbc.url Database connection URL.
jdbc.user Database user name.
jdbc.password Database user password.
jdbc.table.status Name of table to save the status and output of each job in.
jdbc.… Optional PostgeSQL configuration properties.
beyondcron.status.service JDBC
jdbc.url Database connection.
jdbc.user Database user name.
jdbc.password Database user password.
jdbc.table.status Name of table to save the status and output of each job in.
jdbc.… Optional database configuration properties.

Notes:

  • jdbc.password is a secret configuration variable, and as such can only be viewed by users with write access to /_beyondcron/configuration.
  • if jdbc.url, jdbc.user & jdbc.password are all undefined, AND a JDCB config service is configured, BeyondCron will attempt to use the config service environment variables JDBC_URL, JDBC_USER, JDBC_PASSWORD & JDBC_… to connect to the database.

Table

This service requires the following table:

Table Required permissions
jdbc.table.status Select/Insert/Update/Delete

with the following colums:

Column Type Nullable Default Primary key
bc_name VARCHAR(2048)
bc_timestamp BIGINT
bc_start_timestamp BIGINT
bc_state VARCHAR(32)
bc_result VARCHAR(32)
bc_value INTEGER
bc_message TEXT
bc_trigger TEXT
bc_output LONGTEXT
Column Type Nullable Default Primary key
bc_name TEXT
bc_timestamp BIGINT
bc_start_timestamp BIGINT
bc_state TEXT
bc_result TEXT
bc_value INTEGER
bc_message TEXT
bc_trigger TEXT
bc_output TEXT
Column Java type Size Nullable Default Primary key
bc_name String >= 2KB
bc_timestamp long
bc_start_timestamp long
bc_state String 32B
bc_result String 32B
bc_value int
bc_message String >= 2KB
bc_trigger String >= 2KB
bc_output String >= 2MB
bc_removed boolean false

If the user account has permission, BeyondCron will create the table if it does not already exist.

Example

BeyondCron % config set jdbc.url jdbc:mysql://database.example.com:3306/beyondcron
BeyondCron % config set jdbc.user beyondcron
BeyondCron % config set jdbc.password Secret!
BeyondCron % config set jdbc.table.status bc_status
BeyondCron % config set beyondcron.status.service JDBC
BeyondCron % status service reload

BeyondCron % config set jdbc.url jdbc:postgresql://database.example.com:5433/beyondcron
BeyondCron % config set jdbc.user beyondcron
BeyondCron % config set jdbc.password Secret!
BeyondCron % config set jdbc.table.status bc_status
BeyondCron % config set beyondcron.status.service JDBC
BeyondCron % status service reload

BeyondCron % config set jdbc.url jdbc:…
BeyondCron % config set jdbc.user beyondcron
BeyondCron % config set jdbc.password Secret!
BeyondCron % config set jdbc.table.status bc_status
BeyondCron % config set beyondcron.status.service JDBC
BeyondCron % status service reload

Setup JDBC using the same connection configuration as the JDCB config service.

BeyondCron % config set jdbc.table.status bc_status
BeyondCron % config set beyondcron.status.service JDBC
BeyondCron % status service reload

See also

Reference