buildframework/helium/doc/src/manual/messaging.rst
author Ross Qin <ross.qin@nokia.com>
Tue, 30 Nov 2010 14:05:41 +0800
changeset 713 7b7f0409fc00
parent 628 7c4a911dc066
permissions -rw-r--r--
merge

Messaging
=========

Currently the communication to external services (diamonds, ats, internal logging framework)
are done within helium as REST / SOAP client, which is not scalable and had limitations
and lot of overheads in terms communication with those external services.

 

Overview
--------

The messaging framework is aimed to address this issue by defining
the input using which the data is exchanged to the external system. Currently the
main focus is to define the input format for the messaging framework and to work with
existing framework. In the future directly interact with the messaging system to exchange
data to the external system.

Currently there are three types of messages could be defined, which works with
existing system to send data to diamonds.

Text Message
~~~~~~~~~~~~

Any text message to be sent to the diamonds could be possible with the message type
definition. Example to use it as below,


.. code-block:: xml

      <hlm:textMessage id="initial-message" text="<diamonds-build>
    <schema>21</schema><build>
    <category>ido_BtDo_tb101-release_btservices_sbs-ec</category>
    <name>IDO_BtDo_tb101-release_btservices_10.1.69</name>
    <started>2010-08-04T13:23:54</started></build></diamonds-build>" />

File Message
~~~~~~~~~~~~

Any file which needs to be sent using messaging framework could be defined 
using file message. Example to use it as below,

.. code-block:: xml

      <hlm:fileMessage id="initial-message" file="${build.output.dir}/initial-message.xml" />
      
Here the the attribute value for file attribute pointing to the file to be sent is forwarded
to the destination.


FMPP Message
~~~~~~~~~~~~

Any message generated by processing the fmpp template data could be defined using
the fmpp message. Example is,

.. code-block:: xml

      <hlm:fmppMessage target="diamonds" sourceFile="tool.xml.ftl"&gt;
          <data expandProperties="yes"&gt;
          ant: antProperties()
          </data>
      </hlm:fmppMessage>
      
The above definition format is similar to fmpp conversion task, except that it has
limitation to convert one file using the template. Before sending data, the input template
is converted and an internal file message is created with the converted file path and 
sent to the diamonds.

TargetMessage Trigger
~~~~~~~~~~~~~~~~~~~~~

TargetMessageTrigger type maps a message to a particular target and could be used to
send the input message for the target execution. Example is as below,


.. code-block:: xml


        <hlm:targetMessageTrigger id="codescanner.id" target="ido-codescanner">
            <hlm:fmppMessage sourceFile="${helium.dir}/tools/common/templates/diamonds/codescanner.xml.ftl">
                <data expandProperties="yes">
                    ant: antProperties()
                    doc: xml(${ido.codescanner.output.dir}/problemIndex.xml)
                </data>
            </hlm:fmppMessage>
        </hlm:targetMessageTrigger>
 

In the above example, the target ido-codescanner contains an fmpp message. When
the target executes the target ido-codescanner at the end of execution which converts
the input file using template and the output file is sent to diamonds.