Configure a HTTP processor
Learn how to configure an HTTP processor to enable real-time data enrichment by calling external APIs within a mediation flow.
- Navigate to Mediation > Meters.
- Create a Custom meter.
- Select and drag the HTTP processor type on to the meter stream page.
The HTTP processor settings page is displayed.
- In the HTTP settings page, enter a Name for the processor.A unique Operator ID for this processor component is displayed. This unique ID is used for event logging. You can copy this ID to be used in external applications.
- From the Method drop-down list, select the method to be used for the API call.
- Select the Connection to be used to access the resource.When configuring the HTTP Operator, you must select an existing connection from the Connection dropdown list. This connection defines the base URL, authentication, and headers used in your HTTP requests. Use the Manage Connections button under Mediation > Meters to create a connection.
- If needed, you can enter the Path to the specific resource.You can use variables in this path.
https://api.partner.com/{{event.customerId}} - Click the Headers tab to specify the key value pairs which will be sent as a part of the API call.
- Click + Add Field and specify a Key and Value for each header.
Content-Typeandapplication/json. - Click the Params tab to specify the query and path parameters.
- Click + Add Field and specify a Key and Value for each parameter.
- Click the Body tab and paste the request body.You can use nested JSON or plain text payloads.
- Click the Response tab and paste the code for a sample API response.This sample is used to:
- Configure field mappings: you map JSON paths from the sample response to target fields in the event.
- When you enable Use sample response for test run and run the meter in Test Mode, no outbound HTTP request is made. The HTTP processor returns the sample response from the Response tab and applies your field mappings to that mock data instead. In normal (non-test) runs, this option is ignored and the processor always calls the real endpoint.
- Below the sample response, map each Source Field from the response to the corresponding Target Field in the event, to be enriched.
- Click Advanced Settings to configure configure advanced behavior for the HTTP call.
- In the Timeout field, specify the maximum time in milliseconds to wait for an HTTP response.The default timeout value is set to 30000 milliseconds.
- In the Timeout Retry field, specify the number of retry attempts to be made if the HTTP call fails due to transient issues (for example, network errors).
- In the Max Concurrency field, specify the maximum number of HTTP requests that this HTTP processor can execute in parallel.The value should be an integer between 1 and 100.The default value is 20. If you enter a non-integer value (for example, 1.5) or a value outside the supported range, the configuration fails with a The parameter concurrency limit is invalid error.
- In the Timeout field, specify the maximum time in milliseconds to wait for an HTTP response.
- If you want the pipeline to continue even when the HTTP call or mock mapping fails, select the Pass on event in case of error check box. When this box is cleared, events with HTTP or mapping errors are sent to the error stream instead.
- After configuring the processor, click Save.