{ Community }
  • Academy
  • Docs
  • Developers
  • Resources
    • Community Articles
    • Apigee on GitHub
    • Code Samples
    • Videos & eBooks
    • Accelerator Methodology
  • Support
  • Ask a Question
  • Spaces
    • Product Announcements
    • General
    • Edge/API Management
    • Developer Portal (Drupal-based)
    • Developer Portal (Integrated)
    • API Design
    • APIM on Istio
    • Extensions
    • Business of APIs
    • Academy/Certification
    • Adapter for Envoy
    • Analytics
    • Events
    • Hybrid
    • Integration (AWS, PCF, Etc.)
    • Microgateway
    • Monetization
    • Private Cloud Deployment
    • 日本語コミュニティ
    • Insights
    • IoT Apigee Link
    • BaaS/Usergrid
    • BaaS Transition/Migration
    • Apigee-127
    • New Customers
    • Topics
    • Questions
    • Articles
    • Ideas
    • Leaderboard
    • Badges
  • Log in
  • Sign up

Get answers, ideas, and support from the Apigee Community

  • Home /
  • Edge/API Management /
avatar image
0
Question by Santhosh Malluru · Jul 02, 2020 at 10:16 AM · 57 Views service calloutservicecallouthttpclientroute rules

Routerule in ServiceCallout

Is it possible to use RouteRule in ServiceCallOut Policy?

My requirement : In ServiceCallOut Policy, HTTPTargetConnection/URL will changes dynamically based on environment.name. Please suggest best approach.

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ServiceCallout async="false" continueOnError="false" enabled="true" name="Service-Callout-1">
    <DisplayName>Service Callout-1</DisplayName>
    <Properties/>
    <Request clearPayload="true" variable="myRequest">
        <IgnoreUnresolvedVariables>false</IgnoreUnresolvedVariables>
    </Request>
    <Response>calloutResponse</Response>
    <RouteRule>
        <Condition>(environment.name = "test")</Condition>
        <HTTPTargetConnection>
            <URL>http://test.apis.com</URL>
        </HTTPTargetConnection>
    </RouteRule>
    <RouteRule>
        <Condition>(environment.name = "uat")</Condition>
        <HTTPTargetConnection>
            <URL>http://uat.apis.com</URL>
        </HTTPTargetConnection>
    </RouteRule>
    <RouteRule>
        <Condition>(environment.name = "prod")</Condition>
        <HTTPTargetConnection>
            <URL>http://prod.apis.com</URL>
        </HTTPTargetConnection>
    </RouteRule>
</ServiceCallout>

Comment
Add comment
10 |5000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by Apigeeks only
  • Viewable by the original poster
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Close

1 Answer

  • Sort: 
avatar image
0

Answer by Nagashree B   · Jul 02, 2020 at 05:51 PM

@Santhosh Malluru

There is no provision to use routerules in a service callout.

Looking at your example above, it seems like you should use a target server configuration in the service callout and let it handle the environment based backends. You can see more information in the post below.

https://community.apigee.com/questions/37721/how-do-we-configure-and-call-target-server-from-se.html

If you need some conditional routing to be done to multiple backends by using service callouts, an alternative would be to execute your service callout conditionally

<Step>
                    <FaultRules/>
                    <Name>ServiceCallout-1</Name>
<Condition>request.header.abc = "route1"</Condition>
                </Step>

<Step>
                    <FaultRules/>
                    <Name>ServiceCallout-2</Name>
<Condition>request.header.abc = "route2"</Condition>
                </Step>
Comment
Add comment · Link
10 |5000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by Apigeeks only
  • Viewable by the original poster
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Follow this Question

Answers Answers and Comments

74 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

how to get the service callout request sent and response received timestamp? 1 Answer

working code of curl in postman Not able to convert to service call out code 2 Answers

What is the best way to make multiple call outs to compose a response? 2 Answers

Not able to remove/reset the servicecallout.requesturi variable 2 Answers

How can I add a payload to a service callout? 3 Answers

  • Products
    • Edge - APIs
    • Insights - Big Data
    • Plans
  • Developers
    • Overview
    • Documentation
  • Resources
    • Overview
    • Blog
    • Apigee Institute
    • Academy
    • Documentation
  • Company
    • Overview
    • Press
    • Customers
    • Partners
    • Team
    • Events
    • Careers
    • Contact Us
  • Support
    • Support Overview
    • Documentation
    • Status
    • Edge Support Portal
    • Privacy Policy
    • Terms & Conditions
© 2021 Apigee Corp. All rights reserved. - Apigee Community Terms of Use - Powered by AnswerHub
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Create an article
  • Post an idea
  • Spaces
  • Product Announcements
  • General
  • Edge/API Management
  • Developer Portal (Drupal-based)
  • Developer Portal (Integrated)
  • API Design
  • APIM on Istio
  • Extensions
  • Business of APIs
  • Academy/Certification
  • Adapter for Envoy
  • Analytics
  • Events
  • Hybrid
  • Integration (AWS, PCF, Etc.)
  • Microgateway
  • Monetization
  • Private Cloud Deployment
  • 日本語コミュニティ
  • Insights
  • IoT Apigee Link
  • BaaS/Usergrid
  • BaaS Transition/Migration
  • Apigee-127
  • New Customers
  • Explore
  • Topics
  • Questions
  • Articles
  • Ideas
  • Badges