Type to start searching...

Message : Root Message

A message carries information from a source system to a destination system over an integration channel.

Description

Messages are maintained in the integration layer and are used to carry information between systems.

Each message type is represented internally (in canonical form) as a tree of parts. An internal representation might look like

Messages have a single root part that defines certain characteristics for the entire message, such as it's format. The root's child parts are either:


* messages - composite parts that may have more child parts
* or values - primitive parts such as string, integer, date, ...

To programmatically create a message use the (message) function. You may create a message of a certain type with it's :class property.

e.g. (define myMessage (message (: :class "SystemXMessage")))

A message's format defines how it is marshalled between external and internal format. e.g. between canonical form and XML. Supported formats include CSV, Fixed, HL7, Object, vCard, XML and Zip. To format a message, use the (format-message msg) procedure. See "parse-message" for information about creating internal messages from external inputs, such as CSV files.

Messages support inheritance and containment. Messages may extend other messages using the "base" property and may contain other message types using the "ref" property.

Raw messages are special types of system messages tha vary by the type of channel on which they are received or sent. All raw messages have the following parts:


* channel - the channel name that the message was received on
* body - the body of the message.  (not applicable to an HTTP Get)
* correlationId - an identifier used to correlate messages.  Useful in asynchronous settings.

Additional parts by channel type include:


HTTP
    * url - the base URL on which to send the request.  e.g. http://localhost:7080/nexj/xml/Account.
      If you use the outbound parameters argument, you MUST end the url with "?".
      e.g. "http://localhost:7080/nexj/xml/Account?"
    * method - The type of HTTP request.  On outbound, Defaults to "GET" if the body is null,
      "POST" if the body is specified.
    * headers - A transfer object with headers.
    * parameters - A transfer object with key/value pairs of parameters from the incoming message
      or parameters to send outgoing. The values should be strings or something that is easily encoded
      as a string and will be URL encoded automatically.  If you are sending parameters on an outbound
      request, you must end the URL with "?".
      e.g. "http://localhost:7080/nexj/xml/Account?"
    * path - the path after the channel name in the incoming request URL.  e.g. /nexj/xml/Account
    * principal
    * status - Status code of the HTTP response, e.g. 200
    * password
    * message - e.g. "OK"
    * proxyHost
    * proxyPort
    * proxyUser
    * proxyPassword

JMS
    * properties (jmsErrorCount, jmsMaxErrorCount, jmsBackoffDelay, jmsOldMessageId,
      jmsOldDestination)
    * priority - message priority 0..9
    * persistent - boolean
    * ttl - time-to-live
    * type
    * replyTo - reply-to destination name
    * node - source node
    * user
    * protected

Mail
    <not implemented as a channel adapter yet>

UDP
    * host
    * port
    * localHost
    * localPort
    * ttl - time-to-live
    * tos - service level

TCP
    * host
    * port
    * localHost
    * localPort

File
    * file - the incoming filename (when receiving) and filename override (when sending).

Properties
aggregation

Child part aggregation mode.

Child parts must appear in the order specified (sequential), in any order (random) or only one choice of the children may appear (single).

When "ref" is set, the aggregation from the referenced message part is used and the aggregation on the reference is ignored.

Valid values based on“string”.
sequential

The contained parts must appear in their order of declaration.

random

The contained parts may appear in any order.

single

Only one of the contained parts may appear. This implies a 'choice'.

base : string

The name of the base message, if any. Used to support message inheritance.

derivation

Substitute with derived message during parse/format; virtual: allow; abstract: require; final: disallow.

Valid values based on“string”.
virtual

Allow derived messages.

final

Disallow derived messages.

abstract

Require derived messages.

description : string

Message description.

format : string

Specifies how a message is marshalled between external and internal representation.

For each Message we may specify a Format which defines how a message is marshalled between external and internal representation. The way that parts are mapped to external representation depends on the format. Supported formats include:


* CSV - comma separated value
* Fixed - fixed-length fields ("flat file") format
* HL7 - health level 7 format
* Object - the message is mapped to an internal class.
* vCard - standard for electronic business cards.
* XML - XML messages and optional soap wrappers.
* Zip - represents a zip file archive.

lax : boolean

True to allow and ignore unidentifiable child parts in a raw message when parsing.

Lax is mainly used during message parsing. Set it to true to allow and ignore unidentifiable child parts in a raw message when parsing. If lax is false - the default - the parser will throw an error if it encounters a message part that is not in the message definition, like an extra XML attribute or a CSV column.

When "ref" is set, the lax setting from the referenced message part is used and the lax setting on the reference is ignored.

Example


For an RSS message definition, you probably want to set the root tag
to "lax" as most RSS feeds have custom attributes added to their XML.  If
a custom attribute was found in a message that your message definition
didn't expect and the "lax" flag was false, the message would be rejected.

ref : string

Message defining this part (and any subparts).

If the ref is set to another message name, then this part will be defined by the structure of that message.
response : string

The Response attribute allows you to pair-up a request/response set of message formats. (optional)

Content
  • Sequence of:

    • Parts [0..1] - A message is represented internally (in canonical form) as a tree of parts.

  • Sequence of:

    • Choice of:

      • ObjectMapping [1..1] - Maps message parts to attributes in class instances.

      • FixedMapping [1..1] - Maps message parts to record fields in a fixed length file, or flat file database.

      • JSONMapping [1..1] - Maps message parts to JSON objects, arrays or primitives.

      • AvroMapping [1..1] - Maps message parts to Avro objects, arrays or primitives.

      • HL7Mapping [1..1] - Maps message parts to segments and fields in a Health Level Seven (HL7), v2.x file.

      • CSVMapping [1..1] - Maps message parts to columns in a CSV file.

      • XMLMapping [1..1] - Maps message parts to XML elements, attributes or values.

      • ZipMapping [1..1] - Maps message parts to files in a Zip file archive.

      • VCardMapping [1..1] - Maps message parts to elements in a vCard file.

      • Mapping [1..1]