Home
Categories
Dictionary
Glossary
Download
Project Details
Changes Log
What Links Here
FAQ
License

ExternalComm Channel queue management



This article explains how to specify how an ExternalComm Channel which receives content from the network or send content content to the network will manage the emission or reception of this content in the framework.

Note that this is both for buffers received from the network and buffers emitted to the network.

Problem overview

By default the buffer content of the Channel is decoded and immediately posted to the relevant service which is invoked. However this default behavior can lead to problems if the buffer content for the same service is received many times with a short delay from the network. In that case the buffer content for the service may have been modififed before it could be used by the receiver modules in the framework, which could lead to incorrect processed content.
externalcommqueue
The same kind of problem can happen for encoded buffer content to a Channel.

Queue management

Queue management from the Network

The queueServiceOutputs property allows to specify that the content of the buffers must be enqueued in a FIFO queue which will be processed one buffer at a time. The queueServiceOutputsSize property specifies the size of the queue.
externalcommqueue2
There are two ways to specify this property:
  • In the module configuration. This behavior will be used for all the Channels which receive buffers from the network
  • In the Channel configuration. This behavior will be used only for the associated Channel


For example:
      <channel name="event" type="input" port="8080">
         <outputServiceQueue queueType="queue" queueSize="10" />
         <service name="published" />
      </channel>

Queue management to the Network

The queueServiceInputs property allows to specify that the content of the buffers must be enqueued in a FIFO queue which will be processed one buffer at a time. The queueServiceInputsSize property specifies the size of the queue.

There are two ways to specify this property:
  • In the module configuration. This behavior will be used for all the Channels which receive buffers from the network
  • In the Channel configuration. This behavior will be used only for the associated Channel


For example:
      <channel name="event" type="output" port="8080">
         <inputServiceQueue queueType="queue" queueSize="10" />
         <service name="published" />
      </channel>

Invocation type

The invokeCopy property specifies if services coming from the network should be cloned before they are called.

Use cases

In the general case, you don't need to do anything specific about the queue management. If you receive a lot of buffers from the network at a rapid pace, you may see several services with the wrong values because they will be updated by the module before they could be sent. For example:
externalcommqueue2
In that case, you will need to specify both the queueServiceOutputs and the invokeCopy properties to be sure that:
  • You don't miss any buffer coming from the network
  • You keep the content of the services even if you have a lot of buffers for the same service in a short time
For example, at the module level:
      <properties>
         <application name="externalComm" >
            <module name="externalComm" >
               <moduleProperty key="network" value="networkEvent.xml" />
               <moduleProperty key="queueServiceOutputs" value="true" />
               <moduleProperty key="queueServiceOutputsSize" value="20" />
               <moduleProperty key="invokeCopy" value="true" />
            </module>
         </application>
      </properties>
If you send a lot of buffers to the network at a rapid pace, you may need to specifiy both the queueServiceInputs property. For example, at the module level:
      <properties>
         <application name="externalComm" >
            <module name="externalComm" >
               <moduleProperty key="network" value="networkEvent.xml" />
               <moduleProperty key="queueServiceInputs" value="true" />
               <moduleProperty key="queueServiceInputsSize" value="20" />
            </module>
         </application>
      </properties>

Examples

For the module:
      <properties>
         <application name="externalComm" >
            <module name="externalComm" >
               <moduleProperty key="network" value="networkEvent.xml" />
               <moduleProperty key="queueServiceOutputs" value="true" />
               <moduleProperty key="queueServiceOutputsSize" value="20" />
               <moduleProperty key="queueServiceInputs" value="true" />
               <moduleProperty key="queueServiceInputsSize" value="20" />
               <moduleProperty key="invokeCopy" value="true" />
            </module>
         </application>
      </properties>
For one Channel:
      <channel name="event" type="input" port="8080" invokeCopy="true">
         <outputServiceQueue queueType="queue" queueSize="10" />
         <service name="published" />
      </channel>
or:
      <channel name="event" type="output" port="8080">
         <inputServiceQueue queueType="queue" queueSize="10" />
         <service name="published" />
      </channel>

See also


Categories: builtin-applis

Copyright 2017-2020 Dassault Aviation. All Rights Reserved. Documentation and source under the LGPL v3 licence