Obtaining the Return Value of a Rest Client Node

The Rest Client node can execute RESTful requests.

This tutorial describes how to obtain the return value of the Rest Client node, covering the following two application scenarios:

Obtaining the Return Value Through Parameter "The response message body parses the transfer parameter"

As shown in Figure 1, the first Rest Client node invokes the API of MRS to query the cluster list. Figure 2 shows the JSON message body returned by the API.

Figure 1 Rest Client job example 1
Figure 2 JSON message body

Obtaining the Return Value Using an EL Expression

The Rest Client node can be used together with EL expressions. You can select different EL expressions based on scenarios. This section describes how to develop your own jobs based on your service requirements. For details about how to use EL expressions, see EL Expressions.

As shown in Figure 3, the Rest Client invokes the API of MRS to query the cluster list and then invokes the Kafka Client to send a message.

Figure 3 Rest Client job example 2