RESTAsyncResponse node

Use the RESTAsyncResponse node with the RESTAsyncRequest node to construct a pair of message flows that interact asynchronously with an external REST API.

The RESTAsyncResponse node is available in the following operation modes:
  • Developer
  • Application Integration Suite
  • Standard
  • Advanced
  • Express
  • Scale
  • Adapter
For more information, see Operation modes.

This topic contains the following sections:

Purpose

You can use a RESTAsyncResponse node together with a RESTAsyncRequest node, to interact asynchronously with an REST API. The RESTAsyncRequest node issues a REST request to a REST API, and returns control to the flow without waiting for a response. The response is received by the RESTAsyncResponse node, which can be in a separate message flow but must be in the same integration server. The nodes are used as a pair, and correlate responses against the original requests by using a unique identifier, which is specified on both nodes.

If you have created a REST API from scratch in the IBM® Integration Toolkit, a Swagger document was created for you, which you can now import and use with the RESTRequest node. For more information about creating REST APIs, see Creating a REST API.

The RESTAsyncResponse node handles messages in the following message domains:

  • DFDL
  • XMLNSC
  • JSON
  • BLOB
  • MIME
  • XMLNS
  • MRM

The RESTAsyncResponse node is contained in the REST drawer of the palette, and is represented in the IBM Integration Toolkit by the following icon:

RESTAsyncResponse node icon

Terminals and properties

The RESTAsyncResponse node terminals are described in the following table.

Terminal Description
Failure The output terminal to which the message is routed if a failure is detected during processing in the node.
Out The output terminal to which the message is routed if it represents successful completion of the REST API request, and if further processing is required in this message flow.
Error The output terminal to which messages that include an HTTP status code that is not in the range 200 through 299, including redirection codes (3xx) if you have not set the property Follow HTTP(s) redirection property, is routed.
Catch The output terminal to which the message is routed if an exception is thrown downstream and caught by this node.

The following tables describe the node properties. The column headed M indicates whether the property is mandatory (marked with an asterisk on the panel if you must enter a value when no default is defined); the column headed C indicates whether the property is configurable (you can change the value when you add the message flow to the BAR file to deploy it).

The RESTAsyncResponse node Description properties are described in the following table.

Property M C Default Description
Node name No No The node type, RESTAsyncResponse The name of the node.
Short description No No   A brief description of the node.
Long description No No   Text that describes the purpose of the node in the message flow.

The RESTAsyncResponse node Basic properties are described in the following table.

Property M C Default Description mqsiapplybaroverride command property
Unique identifier Yes Yes   The unique identifier that links a pair of RESTAsyncRequest and RESTAsyncResponse nodes. asyncResponseCorrelator

The RESTAsyncResponse node Response Message Parsing properties are described in the following table.

Property M C Default Description
Automatic Content-Type handling No No Selected When this property is selected, the RESTAsyncResponse node automatically selects the message domain to be used to parse the response body, based on the value of the Content-Type header in the response. For example, if the Content-Type header in the response is application/json, the JSON message domain is used. When this property is selected, you cannot specify any other fields on this panel.
Message domain No No BLOB The domain that is used to parse the message. If the field is blank, the default is BLOB.
Message model No No Cleared The name or location of the message model schema file in which the message is defined.

When you click Browse, you see a list of available message model schema files for the selected Message domain.

Message No No Cleared The name or location of the message root within your message model schema file. This list is populated with all available messages that are defined in the Message model that you have selected.
Physical format No No Cleared The name of the physical format of the message. If you are using the MRM or IDOC parser, select the physical format of the incoming message from the list. This list includes all the physical formats that you have defined for the selected message model. If you set the Message domain property to DataObject, you can set this property to XML or SAP ALE IDoc. Set this property to SAP ALE IDoc when you have to parse a bit stream from an external source and generate a message tree.

The RESTAsyncResponse node Parser Options properties are described in the following table.

Property M C Default Description
Parse timing No No On Demand This property controls when a response message is parsed. Valid values are On Demand, Immediate, and Complete.

For a full description of this property, see Parsing on demand.

Build tree using XML schema data types No No Cleared This property controls whether the XMLNSC parser creates syntax elements in the message tree with data types taken from the XML schema. You can select this property only if you set the Validate property on the Validation tab to Content or Content and Value.
Use XMLNSC compact parser for XMLNS domain No No Cleared This property controls whether the XMLNSC Compact Parser is used for messages in the XMLNS Domain. If you set this property, the response message data is displayed under XMLNSC in nodes that are connected to the output terminal when the input MQRFH2 header or Response Message Parsing properties Domain is XMLNS.
Retain mixed content No No Cleared This property controls whether the XMLNSC parser creates elements in the message tree when it encounters mixed text in a response message. If you select the check box, elements are created for mixed text. If you clear the check box, mixed text is ignored and no elements are created.
Retain comments No No Cleared This property controls whether the XMLNSC parser creates elements in the message tree when it encounters comments in a response message. If you select the check box, elements are created for comments. If you clear the check box, comments are ignored and no elements are created.
Retain processing instructions No No Cleared This property controls whether the XMLNSC parser creates elements in the message tree when it encounters processing instructions in a response message. If you select the check box, elements are created for processing instructions. If you clear the check box, processing instructions are ignored and no elements are created.
Opaque elements No No Blank This property is used to specify a list of elements in the response message that are to be opaquely parsed by the XMLNSC parser. Opaque parsing is performed only if validation is not enabled (that is, if the Validate property is set to None); entries that are specified in Opaque Elements are ignored if validation is enabled.

The RESTAsyncResponse node Validation properties are described in the following table.

For a full description of these properties see Validation properties.

Property M C Default Description mqsiapplybaroverride command property
Validate No Yes None This property controls whether validation takes place. Valid values are None, Content and Value, Content, and Inherit. validateMaster
Failure action No No Exception This property controls what happens if validation fails. You can set this property only if you set Validate to Content or Content and Value. Valid values are User Trace, Local Error Log, Exception, and Exception List.  
The Monitoring properties of the node are described in the following table.
Property M C Default Description
Events No No None Events that you have defined for the node are displayed on this tab. By default, no monitoring events are defined on any node in a message flow. Use Add, Edit, and Delete to create, change or delete monitoring events for the node; see Configuring monitoring event sources by using monitoring properties for details.

You can enable and disable events that are shown here by selecting or clearing the Enabled check box.