이 페이지는 Apigee 및 Apigee Hybrid에 적용됩니다.
개요
IntegrationCallout 정책을 사용하면 API 트리거가 있는 Application Integration을 실행할 수 있습니다. 하지만 통합을 실행하기 전에 SetIntegrationRequest 정책을 실행해야 합니다. SetIntegrationRequest 정책은 요청 객체를 만들고 이 객체를 IntegrationCallout 정책에 흐름 변수로 제공합니다. 요청 객체에는 API 트리거 이름, 통합 프로젝트 ID, 통합 이름, SetIntegrationRequest 정책에 구성된 기타 세부정보 등의 통합 세부정보가 있습니다. IntegrationCallout 정책은 요청 객체의 흐름 변수를 사용하여 통합을 실행합니다. 흐름 변수에 통합 실행 응답을 저장하도록 IntegrationCallout 정책을 구성할 수 있습니다.
IntegrationCallout 정책은 프록시 흐름 중에 통합을 실행하려는 경우에 유용합니다. 또는 IntegrationCallout 정책을 구성하는 대신 통합 엔드포인트를 대상 엔드포인트로 지정하여 통합을 실행할 수도 있습니다. 자세한 내용은 IntegrationEndpoint를 참조하세요.
이 정책은 확장 가능한 정책이며, 이 정책을 사용하면 Apigee 라이선스에 따라 비용 또는 사용률이 영향을 받을 수 있습니다. 정책 유형 및 사용 영향에 대한 자세한 내용은 정책 유형을 참조하세요.
<IntegrationCallout>
IntegrationCallout 정책을 지정합니다.
| 기본값 | 해당 사항 없음 |
| 필수 여부 | 필수 |
| 유형 | 복합 유형 |
| 상위 요소 | 해당 사항 없음 |
| 하위 요소 |
<DisplayName><AsyncExecution><Request><Response> |
다음 표에서는 <IntegrationCallout>의 하위 요소를 간략하게 설명합니다.
| 하위 요소 | 필수 여부 | 설명 |
|---|---|---|
<DisplayName> |
선택사항 | 정책의 커스텀 이름입니다. |
<AsyncExecution> |
선택사항 | 통합을 동기 모드 또는 비동기 모드로 실행해야 하는지 여부를 지정합니다. |
<Request> |
필수 | SetIntegrationRequest 정책에 의해 생성된 요청 객체가 있는 흐름 변수입니다. |
<Response> |
선택사항 | 통합 응답을 저장할 흐름 변수입니다. |
<IntegrationCallout> 요소는 다음 구문을 사용합니다.
구문
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <IntegrationCallout continueOnError="[true|false]" enabled="[true|false]" name=POLICY_NAME> <DisplayName>POLICY_DISPLAY_NAME</DisplayName> <AsyncExecution>BOOLEAN_ASYNC_EXECUTION</AsyncExecution> <Request clearPayload="[true|false]">REQUEST_FLOW_VARIABLE_NAME</Request> <Response>RESPONSE_FLOW_VARIABLE_NAME</Response> </IntegrationCallout>
예
다음 예시는 IntegrationCallout 정책 정의를 보여줍니다.
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <IntegrationCallout continueOnError="false" enabled="true" name="Integration-Callout"> <DisplayName>Integration-Callout-1</DisplayName> <AsyncExecution>true</AsyncExecution> <Request clearPayload="true">my_request_flow_var</Request> <Response>my_response_flow_var</Response> </IntegrationCallout>
이 요소에는 다음과 같이 모든 정책에 공통된 속성이 있습니다.
| 속성 | 기본값 | 필수 여부 | 설명 |
|---|---|---|---|
name |
해당 사항 없음 | 필수 |
정책의 내부 이름입니다. 원하는 경우 |
continueOnError |
거짓 | 선택사항 | 정책이 실패할 경우 오류가 반환되도록 하려면 false로 설정합니다. 이는 대부분의 정책에서 예상되는 동작입니다. 정책이 실패해도 흐름 실행이 계속되도록 하려면 true로 설정합니다. 참조:
|
enabled |
참 | 선택사항 | 정책을 시행하려면 true로 설정합니다. 정책을 중지하려면 false로 설정합니다. 정책이 흐름에 연결되어 있어도 정책이 시행되지 않습니다. |
async |
거짓 | 지원 중단됨 | 이 속성은 지원이 중단되었습니다. |
하위 요소 참조
이 섹션에서는<IntegrationCallout>의 하위 요소를 설명합니다.
<DisplayName>
name 속성 외에 이 요소를 사용하여 관리 UI 프록시 편집기에서 자연스러운 다른 이름으로 정책의 라벨을 지정합니다.
<DisplayName> 요소는 모든 정책에 공통으로 적용됩니다.
| 기본값 | 해당 사항 없음 |
| 필수 여부 | 선택사항. <DisplayName>을 생략하면 정책의 name 속성 값이 사용됩니다. |
| 유형 | 문자열 |
| 상위 요소 | <PolicyElement> |
| 하위 요소 | 없음 |
<DisplayName> 요소는 다음 문법을 사용합니다.
구문
<PolicyElement> <DisplayName>POLICY_DISPLAY_NAME</DisplayName> ... </PolicyElement>
예
<PolicyElement> <DisplayName>My Validation Policy</DisplayName> </PolicyElement>
<DisplayName> 요소에 속성 또는 하위 요소가 없습니다.
<AsyncExecution>
통합을 실행할 모드를 지정합니다. 동기식 또는 비동기식으로 통합을 실행할 수 있습니다.
true로 설정하면 통합이 비동기식으로 실행됩니다. false로 설정하면 통합이 동기식으로 실행됩니다.
- 비동기 모드: 통합 실행 요청이 엔드포인트에 도달하면 엔드포인트가 즉시 통합 실행 ID를 반환하지만
<ScheduleTime>요소에서 지정한 시간에 통합 실행을 시작합니다.<ScheduleTime>요소를 설정하지 않으면 통합이 즉시 실행되도록 예약됩니다. 통합이 즉시 실행되도록 예약되지만 몇 초 후에 실행이 시작될 수 있습니다. 통합이 시작되면 다음 두 작업이 수행됩니다.- 호출자가 처리를 계속할 수 있도록 통합이 HTTP
200 OK상태 코드를 반환합니다. - IntegrationCallout 정책이 완료됩니다.
- 호출자가 처리를 계속할 수 있도록 통합이 HTTP
- 동기 모드: 통합 실행 요청이 엔드포인트에 도달하면 엔드포인트가 즉시 통합 실행을 시작하고 응답을 기다립니다. 실행을 완료하는 데 걸리는 최대 시간은 2분입니다. 실행이 완료되면 엔드포인트는 실행 ID와 기타 응답 데이터가 포함된 응답을 반환합니다.
| 기본값 | 거짓 |
| 필수 여부 | 선택사항 |
| 유형 | 불리언 |
| 상위 요소 |
<IntegrationCallout> |
| 하위 요소 | 없음 |
<AsyncExecution> 요소는 다음 문법을 사용합니다.
구문
<AsyncExecution>BOOLEAN</AsyncExecution>
예
다음 예시에서는 비동기 실행을 true로 설정합니다.
<AsyncExecution>true</AsyncExecution>
<Request>
SetIntegrationRequest 정책에 의해 생성된 요청 객체가 있는 흐름 변수를 지정합니다. IntegrationCallout 정책은 통합을 실행하기 위해 이 요청 객체를 Application Integration으로 보냅니다.
| 기본값 | 해당 사항 없음 |
| 필수 여부 | 필수 |
| 유형 | 문자열 |
| 상위 요소 |
<IntegrationCallout> |
| 하위 요소 | 없음 |
<Request> 요소는 다음 문법을 사용합니다.
구문
<Request clearPayload="true">FLOW_VARIABLE_NAME</Request>
예
다음 예시에서는 요청 객체를 my_request_flow_var 흐름 변수에서 사용할 수 있음을 지정합니다.
<Request clearPayload="true">my_request_flow_var</Request>
다음 표는 <Request>의 속성을 설명합니다.
| 속성 | 필수 여부 | 유형 | 설명 |
|---|---|---|---|
clearPayload |
선택사항 | 부울 | 통합 실행 요청을 전송한 후 요청 객체를 메모리에서 지워야 하는지 여부를 지정합니다.
이 속성을 지정하지 않으면 기본값은 |
<Response>
통합 응답을 저장할 흐름 변수를 지정합니다.
이 요소를 지정하지 않으면 정책은 integration.response 흐름 변수에 응답을 저장합니다.
| 기본값 | integration.response |
| 필수 여부 | 선택사항 |
| 유형 | 문자열 |
| 상위 요소 |
<IntegrationCallout> |
| 하위 요소 | 없음 |
통합의 출력은 integration.response.content 또는 flow_variable.content로 액세스할 수 있습니다. <Response> 요소는 다음 구문을 사용합니다.
구문
<Response>FLOW_VARIABLE_NAME</Response>
예
다음 예시에서는 통합 실행 응답을 my_response_flow_var 흐름 변수에 저장합니다.
<Response>my_response_flow_var</Response>
오류 코드
This section describes the fault codes, error messages, and the fault variables set by Apigee when this policy triggers an error. This information is essential if you are developing fault rules to handle faults. To learn more, see What you need to know about policy errors and Handling faults.
Runtime errors
These errors can occur when the policy executes.
| Fault code | HTTP status | Cause |
|---|---|---|
entities.UnresolvedVariable |
500 |
This error occurs if Apigee cannot resolve the integration.project.id
or the integration.name variables. |
steps.integrationcallout.ExecutionFailed |
500 |
This error can occur if the backend target service returns an HTTP error status such as
|
steps.integrationcallout.NullRequestVariable |
500 |
This error occurs if the flow variable specified in the <Request> is null. |
steps.integrationcallout.RequestVariableNotMessageType |
500 |
This error occurs when the flow variable specified by the Request element
is not of message type. |
steps.integrationcallout.RequestVariableNotRequestMessageType |
500 |
This error occurs when the flow variable specified by the Request element
is not of Request message type. |
messaging.adaptors.http.filter.GoogleTokenGenerationFailure |
500 |
This error can occur because of an incorrect service account configuration. The possible causes include:
|
Fault variables
Whenever there are execution errors in a policy, Apigee generates error messages. You can view these error messages in the error response. Many a time, system generated error messages might not be relevant in the context of your product. You might want to customize the error messages based on the type of error to make the messages more meaningful.
To customize the error messages, you can use either fault rules or the RaiseFault policy. For
information about differences between fault rules and the RaiseFault policy, see
FaultRules vs. the RaiseFault policy.
You must check for conditions using the Condition element in both the fault rules and the RaiseFault policy.
Apigee provides fault variables unique to each policy and the values of the fault variables are set when a policy triggers runtime errors.
By using these variables, you can check for specific error conditions and take appropriate actions. For more information about checking error
conditions, see Building conditions.
The following table describes the fault variables specific to this policy.
| Variables | Where | Example |
|---|---|---|
fault.name |
The fault.name can match to any of the faults listed in the Runtime errors table.
The fault name is the last part of the fault code. |
fault.name Matches "UnresolvedVariable" |
IntegrationCallout.POLICY_NAME.failed |
POLICY_NAME is the user-specified name of the policy that threw the fault. | IntegrationCallout.integration-callout-1.failed = true |
관련 주제
Application Integration 기능에 대한 자세한 내용은 Application Integration 개요를 참조하세요.