Connecting to external REST APIs

IBM® Integration Bus provides a set of REST nodes, which enable you to interact either synchronously or asynchronously with external REST APIs.

About this task

The following REST nodes are provided with IBM Integration Bus:

An AppConnectRESTRequest node is also provided, which you can use to interact with an IBM App Connect REST API. For more information about using this node, see Connecting to an App Connect REST API.

You can use a RESTRequest node in a message flow to issue synchronous requests to external REST APIs. The RESTRequest node issues a request and then waits for a response from the REST API. Alternatively, you can use a pair of RESTAsyncRequest and RESTAsyncResponse nodes to interact with a REST API asynchronously. The RESTAsyncRequest node sends a REST request, and then returns control to the flow without waiting for a response. The RESTAsyncResponse node, which can be in either the same flow or a separate flow, handles the response from the REST API. A separate thread processes the response, and that thread starts a new transaction to handle the response.

You might want to use asynchronous request-response processing when interacting with a backend server that has a high latency. Using synchronous REST requests can result in multiple outstanding requests that require large numbers of threads to make enough simultaneous connections to the backend server, whereas asynchronous processing allows the response to be decoupled from the request.

For more information about using a RESTRequest node in a message flow, see RESTRequest node. For more information about using the asynchronous REST nodes, see RESTAsyncRequest node and RESTAsyncResponse node.

Procedure

Complete the steps in one the following tasks to configure interactions with external REST APIs by using REST nodes in a message flow: