Data hub message store

Datahub documentation home

Message store

The message store holds messages to be processed by the hub. Each message represents one or more records from the same entity, plus any child entities, valid at one point in time. The processing does not require that the data is held in a database table, and with suitable configuration the actual data could be held in a file system or other data storage technology.

The message store table has the following columns.

message_identifier char(36) A GUID for the message. Unique key for the table.
source_system varchar(255) Reference that identifies the source system for the data. This is optional – if omitted a default based on the entity will be used, assuming that this is supported by the source definition.
source_entity varchar(255) Reference that identifies the entity sent from the source system.
message_timestamp timestamp Point in time when the message was created.
effective_timestamp timestamp Point in time at which this message data is valid.
user_name varchar(255) Name or identifier of user or system who created the data.
refresh boolean If set to true, this is intended to replace all the data on the target entity. Any records on the target entity not in this message should be deleted.
options
text
Options on the message.
data text The data of the message or data which can be used by a data reader to get the message. This allows the actual data to be held in a separate store.
file_path
varchar(1024)
For messages associated with files, the path to the file relative the the file store.

DDL for MySQL.

CREATE TABLE message_store (
  message_identifier char(36) NOT NULL,
  source_system varchar(255),
  source_entity varchar(255),
  message_timestamp timestamp(6) NULL,
  effective_timestamp timestamp(6) NULL,
  user_name varchar(255),
  refresh boolean,
options text,
  data text,
file_path varchar(1024),
  PRIMARY KEY (message_identifier)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

Message Process

The message process table records the current state of the message processing.

Although it has the same primary key, message process is separate from the message store because some implementations may choose to hold the message store separately, for example because of large volumes.

message_identifier
char(36) A GUID for the message. Unique key for the table.
status
integer Indicates current processing status of message. One of:
0 – not processed
1 – processing
2 – requires reprocessing
10 – processed successfully
>= 20 - error
See status for a full list.
processed_timestamp
timestamp Point in time when processing was last attempted (whether or not it completed successfully).
next_attempt_timestamp
timestamp Point in time at or after which a message marked as “requires reprocessing” should next be reprocessed.
error_message
varchar(255) The main message associated with the latest processing attempt.
DDL for MySQL.
CREATE TABLE message_process (
  message_identifier char(36) NOT NULL,
  status integer,
  processed_timestamp timestamp(6) NULL,
  next_attempt_timestamp timestamp(6) NULL,
  error_message varchar(255),
  PRIMARY KEY (message_identifier)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

Message history

The message history contains a history of the the processing associated with each run of the message processor.

message_identifier char(36) A GUID for the message.
processed_timestamp timestamp Point in time when processing was attempted.
status
integer The status at the end of the processing.
error_message
varchar(255)
The main message associated with this processing attempt.
log_text text Log of the processing. This shows all errors (The error_message column on the message_store shows only the first error message).

The message log is keyed on message_identifier and processed_timestamp.

DDL for MySQL.

CREATE TABLE message_history (
  message_identifier char(36) NOT NULL,
  processed_timestamp timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6),
  status integer,
  error_message varchar(255),
log_text text,
PRIMARY KEY (message_identifier, processed_timestamp)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;