Introduction

MTS (Message Transfer System) is a replacememt of former MRS package. The principal difference is that MTS does not expose API for sending and receiving messages, that is all done using pure ERS API. The only thing which is MTS-specific is subscription criteria syntax and name of MTS stream used in configuration of ERS via TDAQ_ERS_<STREAM> environment, which is mts.

Package content

MTS package contains transport library, implementation of a ERS output stream 'mts' (loaded by default by libers.so) - libmts.so for C++ and mrs.jar for Java, and few example applications (ready-to-use command line utilities) for sending and receiving messages in java and C++.

Sending messages

You only need to use 'mts' stream in ERS configuration, for exmaple:

>export TDAQ_ERS_ERROR='mts,lstderr'
>export TDAQ_ERS_FATAL='mts(initial),lstderr'

Stream name accepts partition name as parameter.
Examples for sending the messages:
C++:    https://svnweb.cern.ch/cern/wsvn/atlastdaq/DAQ/online/mts/tags/mts-00-12-05/examples/ers_sender.cc
Java:    https://svnweb.cern.ch/cern/wsvn/atlastdaq/DAQ/online/mts/tags/mts-00-12-05/jsrc/test/TestReporter.java

Subcribing and receiveing messages

Selection criteria syntax allows to filter messages specifying selection expressions using ERS Issue attributes:
severity (sev), applicationID (app), messageID (msg), qualifiers (qual), grouping of expressions and arbitrary logical combination (and, or, not) of them. Syntax is defined using EBNF notation (http://www.cs.cmu.edu/~pattis/misc/ebnf.pdf):

key = 'app' | 'msg' | 'qual'
sev = 'sev'
sevlev = 'fatal' | 'error' | 'warning' | 'info' | 'information'
token = +[a-zA-Z_:\]-'*'
item = (key ('=' | '!=') token) | (sev ('=' | '!=') sevlev)
factor = item | ( expression ) | ('not' factor)
expression = '*' | factor *(('and' expression) | ('or' expression))

Keys and logical operators are case-insensitive. String comparison operations (line 3 matching key with token) supports simple pattern matching. An example of a selection criteria is

(sev=ERROR or sev=FATAL) or (app=Tile* and not qual=debug)

The syntax parsing is done by boost::spirit framework, see SubscriptionParser.h.

Examples of subscribing and receiving messages:
C++: https://svnweb.cern.ch/cern/wsvn/atlastdaq/DAQ/online/mts/tags/mts-00-12-05/examples/mts_ers_receiver.cpp
Java: https://svnweb.cern.ch/cern/wsvn/atlastdaq/DAQ/online/mts/tags/mts-00-12-05/jsrc/test/TestReceiver.java