Message types
A named handle for a recognizable shape of data, the contract subscriptions, maps, and tracking rules reference.
A message type gives a friendly name to the kind of payload moving through your integration, PurchaseOrder, InvoiceAck, InventorySnapshot, whatever vocabulary the business uses. Once a message has been classified as a particular type, the rest of the platform, subscriptions, maps, pipeline components, tracking, can reason about it by name instead of by where it came from.
Message types live inside an Application. Each one carries a Format, an optional Description, optional Sample data, and a set of Promotions that elevate selected payload values into named tokens any downstream expression can read.
In BizTalk, a message type is a schema, the schema's target namespace and root element name together form the type, and defining a type without a schema is impossible. iQBus takes the opposite stance: a message type is a name you choose, and a schema is an optional, additive validation layer you may associate with it later.
The practical effect is that you can introduce a new type for an integration in seconds, no XSD, no canonical model, no contract negotiation up front. When (and if) you decide a structural check is warranted, you create a schema and bind it to the type. Until then, the type is purely a label the platform uses for routing, mapping, and tracking.
Message types are scoped to an Application. From the application menu, the Message types list shows every type you have defined. Each entry has these fields:
| Field | Purpose |
|---|---|
| Name | How the message type is referenced everywhere else, in subscriptions, maps, schema associations, and the runtime tag attached to each message. |
| Format | One of the platform's Formats, JSON XML CSV TXT TAB POS EDI HL7 SWIFT NCPDP BIN today, with more added over time. Declares the shape the payload is expected to take. See Format below. |
| Description | Free-text description for human readers. Optional, has no runtime effect. |
| Schema | The optional structural contract associated with the type. See Relationship to schemas below. |
| Sample data | A representative payload stored on the type. Optional, no runtime effect: it documents the shape for human readers and it seeds the Generate Path helper used to build promotion paths. See Sample data and Generate Path below. |
| Promotions | The named path expressions, XPath for an XML type and JPath for a JSON type, that lift values out of the payload. Each promotion can be flagged Secure. See Promotions below. |
The list view follows the platform's Selected Application behavior, with an Application selected, the list filters to it and the Application column is hidden; with no selection, the list spans every Application you have access to and the column is shown. Creating a new message type uses the same flow: with an Application selected, the form opens with that Application preemptively chosen; without one, the form exposes an Application picker.
Format declares the shape the payload is expected to take. The list today is JSON XML CSV TXT TAB POS EDI HL7 SWIFT NCPDP BIN, and it grows as the platform picks up more standards.
Format is primarily a hint, the runtime does not parse the payload simply because a Format is set, but it gates two things that do matter: which schema type can be associated with the message type, and whether Promotions can be defined. That gate splits the whole list into two camps, and it splits it the same way however long the list gets.
| Format camp | Schema | Promotions |
|---|---|---|
| XML and JSON | Pair directly with a schema, XSD with XML, JSON Schema with JSON. | Supported, XPath against an XML payload and JPath against a JSON payload. |
| Every other Format | No direct schema. Validate by disassembling to XML or JSON first. | Not supported directly. Disassemble to XML or JSON if you need promoted values. |
The split is the whole of the functional story. Only XML and JSON change what the runtime can do, and they are also the only two a map can read as its source. A Format added to the list later lands in the second camp unless it is XML or JSON.
A Promotion lifts a value out of the payload and gives it a name, so any downstream expression can reach it with {{Promoted.MessageType.name}} instead of re-parsing the message. Each promotion is a pair: a name you choose, and a path expression the runtime evaluates against the payload at each instantiation moment, inbound typing and every map output. The path is an XPath on an XML type and a JPath on a JSON type, and you do not have to write it by hand: see Sample data and Generate Path.
Unlike BizTalk's distinguished/promoted property pair, which limits promoted properties to scalar values and forbids them from referencing repeating nodes, an iQBus promotion is one mechanism that handles every shape a path expression can return:
| Resolves to | XPath returns | Example expression | Reference |
|---|---|---|---|
| Scalar | A single text node or attribute | /Order/CustomerId | {{Promoted.Order.CustomerId}} |
| List | A node-set with multiple matches | /Order/Lines/Line/SKU | {{Promoted.Order.SKUs}} |
| Sub-tree | A single inner element with its children | /Order/ShipTo | {{Promoted.Order.ShipTo}} |
| Whole message | The document root | / | {{Promoted.Order.WholeMessage}} |
A promotion that resolves to a list or sub-tree is a real value you can pass to a map, iterate over in a custom function, or wrap inside another payload, not just a flat string. A whole-message promotion is the canonical way to forward or wrap an inbound payload, for instance embedding the original message inside an envelope produced by an outbound map.
{{Promoted.MessageType.Name}}, and that message-type segment is what makes the reference unambiguous. Promotion names need only be unique within a message type: two types may each define a promotion called CustomerId, and {{Promoted.Order.CustomerId}} and {{Promoted.Invoice.CustomerId}} are distinct, fully-qualified references that never collide. A qualified reference resolves only against a message of that type; against any other type it resolves to nothing.Sample data is a representative payload stored on the message type itself. It is free text and it has no runtime effect: nothing is validated against it, nothing is sent, and no message is compared to it. It earns its place in the dialog for two other reasons.
Reference. A type is a name plus a Format, which tells the next engineer nothing about what an InvoiceAck actually looks like. One real message pasted onto the type answers that question in the place where the question gets asked, months later, by whoever opens the type.
Path lookup. It is also the input the path generator works from. Writing a promotion path by hand means walking a nested document in your head and getting the syntax right first time; the generator replaces that with pointing at the value you want.
Every Promotions row carries an ellipsis menu on the right with two entries, Generate Path and Remove. Generate Path opens a payload viewer seeded with the type's Sample data. The viewer is editable, not read only: paste a payload straight into it when the type has no Sample data saved yet, or when the value you are after appears only in a different message. Click the element or property you want and the tool computes its path and shows it in the box below, labelled JPath on a JSON type and XPath on an XML type. Apply Path drops that path into the Path cell of the row you opened the menu from.
Clicking version inside the group object of a JSON payload like this one:
{
"interchange": { "senderId": "CAFECRESCENT", "receiverId": "BLUEHARBORHQ" },
"group": { "functionalId": "PO", "controlNumber": "3187", "version": "005010" },
"transaction": { "setId": "850", "controlNumber": "0001" }
}
produces this path:
$.group.version
The same helper on an XML type walks the document and returns an XPath instead. What is available where follows the Format rules exactly, because Generate Path only exists to fill a promotion path and only XML and JSON types have promotions:
| Format | Generate Path | Produces |
|---|---|---|
| XML | Available on every promotion row | An XPath, for example /Order/ShipTo/City |
| JSON | Available on every promotion row | A JPath, for example $.group.version |
| Every other Format | Not applicable, no Format outside XML and JSON carries promotions | Nothing. Disassemble to XML or JSON first, then promote on that type |
A message type is instantiated at two distinct moments in a flow. At each moment, three things happen in lockstep: the message acquires (or replaces) its type, every promotion defined on that type is evaluated against the current payload, and if a schema is associated with the type, the payload is validated against it.
Moment 1, Inbound typing. At the positions where a message enters the bus, the receive section of a receive port and the response section of a two-way send port, the port's Adapter Message Type is required and the runtime applies it the instant the adapter hands the message to the next step inside the port. There is no untyped window and nothing to fall back to. From there each pipeline component that runs sets a Message Type on every message it emits, keeping the type it was handed or replacing it with one it works out from the payload, and the type left on the message when the pipeline finishes is the type the bus publishes under.
Two things set the type on the way in, in that order:
Adapter Message Type. Every receive port carries one on its receive section, and every two-way send port carries one on its response section. It is required, not a default of last resort, and it is the first thing that happens to the message: the runtime applies it as the adapter hands the message on, before any variable stage or pipeline runs. The underlying property is Port.receivedMessageTypeId. Point it at the type that describes the payload as it actually arrives, the raw EDI interchange, the HL7 batch, the PDF bytes, rather than the shape you intend to turn it into later.
Pipeline component classification. A pipeline component inspects the payload and sets the Message Type on every message it returns: from a header, from a routing key in the body, from the source connection, from whatever signal the upstream system provides. This is mandatory rather than opportunistic. A component that splits an interchange into two hundred messages types all two hundred, and a component that leaves the body alone still states the type it was handed. Setting a type that does not exist in the Application is a separate and real error: the string must match a defined type.
The same rule holds at outbound positions, the send section of a send port and the response section of a two-way receive port. A pipeline there is usually doing post-processing rather than deciding what the message is, but it types everything it emits all the same, and the type governs how the message is treated on the way to the wire. Neither a pipeline nor a component has a direction of its own; see Components classify the Message Type in the Pipelines article for the definition and the four positions, and Receive port for the port-side settings.
Moment 2, Map output. Every map produces a new message with its own destination type. Once the map runs, the message that emerges is a fresh instance: a new type tag, a new round of promotion evaluation against the new payload, and a new schema-validation pass if the destination type has a schema associated. The pre-map type does not carry over, the new message replaces it in the flow.
{{Promoted.MessageType.Name}} resolves there as well. What has not happened yet is the pipeline: a promotion on a type a component or a map stamps later has nothing behind it at that stage. The same applies to the response side of a two-way send port. Close Variables runs after the map, so by that stage the message has its post-map type and that type's promotions.Anywhere a string can be typed in the platform, subscription expressions, map bindings, pipeline component property values, custom function arguments, you can reference the current message's type, its promotions, and application variables with double-curly-brace tokens. Subscription expressions accept two further forms alongside the tokens: a body path via {{Message.Body}}.XPath() / .JPath(), and calls to custom functions. The exception is naming an object itself: the Name field on a message type, port, schema, etc. is a literal, never an expression.
| Source | Resolves to |
|---|---|
{{Message.MessageType}} | The Name of the message type the current message carries. Useful in subscription expressions and any other context that needs to branch by type. |
{{Promoted.MessageType.PromotionName}} | The value of the named promotion, qualified by its message type and evaluated against the current message's payload. Resolves to a scalar, list, sub-tree, or the whole message depending on how the promotion's XPath was defined; against a message of any other type it resolves to nothing. Use Exists(…) to test whether it resolved at all, separately from what it resolved to. |
{{Variable.VariableName}} | The current value of the named application variable. The name is declared on the Application; the value travels with the message, or is shared across the arrival when the variable is Global. Resolved by the same expression engine, mix freely with the two tokens above. |
{{Config.PortName}} | The Name of the port the current message originated from, useful for routing on provenance, e.g. a send port that subscribes only to messages a given receive port published. Part of the {{Config.*}} runtime-context family. |
{{Message.Body}}.XPath(…) | A value read directly from the message body via .XPath (XML) or .JPath (JSON). Useful in a subscription when you want to filter on a value that has not been promoted. |
| Custom function call | A call to a user-defined custom function that returns a Boolean or coercible value. The function runs against the current message and any token arguments you pass. |
A subscription expression that picks up only invoices coming through the bus, for example, looks like this:
{{Message.MessageType}} == "Invoice"
And a subscription that narrows further by promoted property:
{{Message.MessageType}} == "Invoice" && {{Promoted.Invoice.Currency}} == "USD"
A promotion whose XPath finds nothing on a given message resolves to nothing, and the comparison above simply does not match. Where the promoted field is optional in the payload, that leaves you unable to tell a missing field from a different value, so the grammar can test the promotion's existence directly. Exists(…) matches whenever the promotion resolved, whatever it holds; !Exists(…) matches when it did not resolve at all; and == NULL sits between them, matching only a promotion that resolved but carries no value.
{{Message.MessageType}} == "Invoice" && !Exists({{Promoted.Invoice.Currency}})
This is worth keeping in mind when you design promotions, per Promote the minimum: a promotion on an optional element is not an error, it just resolves to nothing on the messages that omit it, and Exists is how a subscription reads that.
Subscription mechanics, how the bus matches messages to send ports, the full expression grammar, and the role of promoted properties in routing, are documented in the Subscriptions and Message Types section of the Ports article. The full set of binding tokens, including Variables, Constants and Config, and where each is used is consolidated in Expressions & bindings.
Three things happen at every instantiation moment, whether that is inbound typing before publish or the output of a map further along. They run in this order, but they run together: the order describes what depends on what, not stages a flow can sit between. At an inbound position the whole set fires at the adapter handoff, so the type is assigned and its promotions are evaluated in the same step, before anything else in the port runs.
| Stage | What happens |
|---|---|
| Type assignment | The message acquires a type: from the port's Adapter Message Type at the adapter handoff, from a pipeline component stamping one on every message it emits, or from a map producing its destination type further along. Nothing inherits a type silently, every component restates it on the way through. |
| Promotion evaluation | For XML and JSON message types, every promotion's XPath is evaluated against the current payload, in the same step that assigned the type. The results are exposed under Promoted.* until the next instantiation overwrites them. |
| Schema validation | If the message type has a schema associated, the payload is validated against it. A validation failure marks the message as errored and stops it from reaching its subscribers. |
Promotions and schemas are independent of one another. A message type with no schema and no promotions is still a valid type, the runtime tags the message, matches subscriptions on {{Message.MessageType}}, and lets the message flow. Maps dispatch on the resolved Message Type, so even the simplest tagged-only message is enough to drive routing and transformation; and because the map output is itself an instantiation moment, the same three runtime stages fire again on whatever type the map produced.
A schema in iQBus is an optional structural contract that may be associated with a message type at design time. The association lives on the message type, not on a port, so once associated, every message of that type is subject to the same validation regardless of which port it arrived on. The schema’s type must match the message type’s Format (XSD pairs with XML, JSON Schema pairs with JSON), and the absence of an associated schema simply means no validation runs.