DC3bMiddlewareTasks/EventAPI

Task MWI665 - Expose Event API consists of two parts:

  • automatically tag events with type-specific properties
  • enable finer control over event listening, including selection based on runId

Event Types

entity Event

property eventTime - long
A timestamp (in ns since epoch) representing the nominal time of the occurance or state change being reported by this Event. In practice, this will usually be set to the time that the Event was created by the publisher; however, it can be set to any time past or present, depending on the semantics of the Event topic. While this precision of this value is ns, the value may represent only an estimate.
property hostId - string
A unique name for the host (usually the IP hostname) running the process that published the event.
property pubTime - long
The time (in ns since the epoch) that the event was first published. This is set by the EventTransmitter.
property runId - string
A logical name representing the execution context of the publisher. Logically coupled processes may share the same runId.
property status - string
A semantic identifier that uniquely describes the state, change of state, or requested action being communicated by this event. A subscriber can match this identifier (via string compare) against a known of identifiers and assume the implied semantics. If the Event carries no additional semantics (beyond what is implied by the topic and the specific Event type), this property will be an empty string.
property topic - string
This is the name of the channel that this event was received on. This is set by EventBroker? EventTransmitter.

getCustomPropertyNames() - StringArray
Returns the names of the non-standard, application-specific properties attached to this Event. These are properties that are not set automatically when the Event is created or published.
getDate() - string
Return a formatted date string representing the eventTime property.
getProperties():- PropertySet
- Return a PropertySet containing all of the properties attached to this Event. This includes both standard, type-specific properties and additional custom properties.
getPubDate() - string
Return a formatted date string representing the publication time.
getPubTime() - long
Return the value of the pubTime property or zero if it has not been published yet.
getTopic() - string
Return the current value of the topic or an empty string if it has not been published yet.

ExceptionEvent - An event reporting that an unhandled error has been detected by the producing process. Typically, that process or thread has stopped running as a result of this error.

FaultEvent - An Event issued by the Fault System that signals an error condition based on analysis of various Monitor Events. Typically, this will require attention by an administrator or automated agent.


LogEvent - An event representing a Log message. It is used from an EventLog (created from a LogRecord) in order to share that message with other remote components.

Recognized values for the status property include:

start - some logical block of processing (usually identified by the log

property) has just started.

end - some logical block of processing (usually identified by the log

property) has just ended.

Additional fields:

comment - StringArray
The human-readable log messages
level - int
LogRecord's importance property
log - string
LogRecords name property

MonitorEvent - An Event indicating progress or normal change of state of a system. The producing process continues to run after issuing such an event. An example of this might be a heartbeat event.

This is different from a LogEvent in that it may not be persisted in the same way (if at all).


PipelineLogEvent A LogEvent issued by an executing pipeline

Additional fields:

dataId - string
The unique identifier for the data chunk being processed in the current pipeline iteration. If this identifier is not known, the value should be an empty string.
loopnum - int
A number indicating the current pipeline iteration. In the case of the nightly pipelines, this is the iteration for processing the n-th observational visit.
pipeline - string
The logical name (ie. shortName) of the pipeline that generated this message.
sliceId - int
The identifier for the parallel slice process that generated this message. A value of -1 represents the Master Pipeline process.
stageId - int
The identifier for the stage currently running when the message was generated. A value of -1 means that no stage was in context.

Finer Control over Event Listening:

ActiveMQ allows messages to be filtered according to the contents of the message properties.

Basic fields are bool/unsigned char/double/float/int/long long/short/string.

On the Receiver side, messages are filtered through the selector syntax of ActiveMQ. This lets us specify SQL92-style expressions to do filtering. A receiver can specify: "runid = 'srp2009'" to only receive messages whose properties match that. Much more complex expressions are possible.