1. Proxies and Flow

call

Version

Calls an external HTTP endpoint and merges its response into the current message. The endpoint's response body replaces the message body, and its headers are copied onto the message except Server, Content-Encoding and Transfer-Encoding. Runs in both the request and the response flow. The url may contain ${...} expressions that are evaluated against the exchange before each call; a URL without a template marker is used verbatim. On an unknown host or a failed call the exchange is aborted with a Problem Details response. See the examples and tutorials under examples/orchestration and tutorials/orchestration.

Example Configuration

api:
port: 2000
flow:
- call:
url: https://api.predic8.de/shop/v2/products
api:
   port: 2000
   flow:
     - call:
         url: https://api.predic8.de/shop/v2/products

Syntax

call:
url: <string> # required
'$ref': <string>
language: groovy
method: <string>
xmlConfig: {}
call:
  url: <string> # required
  '$ref': <string>
  language: groovy
  method: <string>
  xmlConfig: {}

Attributes

NameRequiredDefaultDescriptionExamples
$reffalse-Reference a component defined under components.-
languagefalseSpELScripting language used to evaluate the value expression.SpEL | groovy | jsonpath | xpath
methodfalseGETHTTP method used for the call. With POST, PUT or PATCH the current message body is forwarded; other methods are sent without a body.POST
urltrue-Target URL of the call. May contain ${...} expressions that are evaluated against the exchange before each call; without a template marker the value is used verbatim. This interceptor cannot be used when allowIllegalCharacters is enabled on the URI factory.https://api.predic8.de/shop/v2/products

Child Structure

ElementCardinalityDescription
xmlConfig0..1XML namespace declarations for XPath expressions in the value.

Can be used in