Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Brokered Messaging System

 Description

The cross-platform message broker employed by DCT is “ActiveMQ,” an open-source JMS- compliant application supplied by the Apache Software Foundation. A detailed description of ActiveMQ and JMS is outside the scope of this document but a brief description is warranted.

In this implementation, ActiveMQ lies between the DCT and LIG systems, which do not directly communicate with each other. Each system publishes its own data to the broker and subscribes to the other system’s data via the broker. Messages are organized using “topics,” which are string identifiers defined by each publisher. Subscribers need to specify the desired topic but do not define it. An arbitrary number of subscribers may exist for any published topic, with each one receiving a copy of each message. Only the broker is aware of which systems are publishing and subscribing to data. ActiveMQ decouples publishers and receivers and is stateless.

DCT will publish to a topic but won’t “know” that LIG components are subscribed to that topic; LIG components will likewise publish to a topic and won’t “know” that DCT is subscribed. The DCT, Broker and LIG applications are operating-system independent and can reside on one or more machines. 

...

Implementation

ActiveMQ Installation

The installation of ActiveMQ is simple as it does not require configurationrequire extensive configuration. Installation instructions and system requirements are specified at the ActiveMQ web site (see referenced documents). The main configuration file is "activemq.xml" and it is advisable to keep a copy from the previous version for reference when upgrading the application.

Java and ActiveMQ

ActiveMQ implements the native Java messaging system (ActiveMQ is written in Java); Java and ActiveMQ can communicate directly.

LabVIEW, ActiveMQ and CMS

LabVIEW does not have a native implementation of JMS. To overcome this incompatibility, the CMS library supplied by the Apache Software Foundation will be utilized. CMS is written in C++ and will be compiled into a Windows DLL that LabVIEW can use. CMS will generate and receive the JMS-compatible messages on behalf of the DCT LabVIEW application layer. CMS will notify LabVIEW of incoming messages by generating a LabVIEW event. LabVIEW will send configuration parameters and messages by passing them to the CMS library. 

...

  • If an object contains one or more objects, its start and end tags are terminated with a windows EOL (ASCII 0x0D 0x0A) sequence.

  • If an object contains only a value, the start tag, value, and end tag are on one line terminated by a CRLF sequence.

These recommendations are for cosmetic purposes only. The actual whitespace used is irrelevant; End-Of-Lines can be of any type desired and arbitrary spaces and tabs (or none at all) can be used.

Examples

Figure 2 is the UML definition of a GuideTargetPosition object, which is composed of an XPosition and a YPosition object (GuideTargetPosition contains the XPosition and YPosition objects). The XPosition and YPosition position objects are peers; each contains a single value. 

The XML representation of GuideTargetPosition as represented in Figure 2: UML representation of GuideTargetPosition is 

Code Block
<GuideTargetPosition>

  <XPosition_mm>

    <xPosition_mm>10</xPosition_mm>

  </XPosition_mm>

  <YPosition_mm>

    <yPosition_mm>2.2</yPosition_mm>

  </YPosition_mm>

</GuideTargetPosition>

If an object inherits an attribute (value) from a parent class, the attribute will be a peer of any other member objects that may exist; the attribute and the member objects will be “peer children” of the parent object. Acontrivedexampleisshownbelow;letussupposethatGuideTargetPositioninheritsan attribute named “Numeric” from its parent class TCSGuiderStatus. The definition and XML representations are almost the same as above; note that the TCSGuiderStatus node now contains the “Numeric” attribute. 

The XML representation of the UML representation in Figure 3: UML representation of GuideTargetPosition if it had a parent attribute is

Code Block
<GuideTargetPosition>

  <Numeric>2.34</Numeric>

  <XPosition_mm> 
 
   <xPosition_mm>10</xPosition_mm>

  </XPosition_mm>

  <YPosition_mm> 
 
   <yPosition_mm>2.2</yPosition_mm>

  </YPosition_mm> 

</GuideTargetPosition>