{ 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 RakbDigital · Mar 19, 2020 at 12:43 PM · 124 Views apigee edgeapigeeapi managementproxy configurationapigee apim

stop/start the traffic in Apigee layer when backend API is timeout

Hi ,

I am using apigee cloud and have a requirement, to stop the traffic to backend api in Apigee layer when any backend api is timeout (http error code 504) for 10 times and again flow the traffic to backend from apigee after 10 mins.

Please suggest , how to know which api is timeout for 10 times (any management api ?) and how to stop/start the traffic to backend .

Comment
Add comment Show 1
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
avatar image RakbDigital · Mar 19, 2020 at 05:25 PM 0
Link

Any suggestion from anyone ? Please suggest.

Close

2 Answers

  • Sort: 
avatar image
0

Answer by Denis Kalitviansky · Mar 22, 2020 at 07:22 AM

I guess you need to manage quota (or cache for quota) and count API failures for a particular amount of time. Cache for 10 minutes can fit. Your key for cache is your service basepath\uuid, and value is the count of the timeouts. First time you have time out, create cache entry for 10 minutes and start the count.

Then, count service A failures (timeouts) for your quota.

Create condition rule that states: if service (Y) have quota X = 10, Raise Fault. After 10 mins cache will die, and we can go again.

Edit: use solution that Dino provided

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
avatar image
0

Answer by Dino-at-Google   · Mar 23, 2020 at 02:46 PM

There is a structure called a "TargetServer" in Apigee that, coupled with Health Monitoring, does what you want.

You need to configure a HealthMonitor for your TargetServers.

Comment
Add comment Show 7 · 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
avatar image Denis Kalitviansky · Mar 23, 2020 at 03:28 PM 0
Link

Wow, Dino, I knew I've missed something, and I tried such functionality some time ago on one of the POC's, how can I missed that...

avatar image Chawki MATTA · Mar 24, 2020 at 07:50 AM 0
Link

@Dino-at-Google if HealthMonitor is enabled and target server was removed from the rotation,

  • can we add an alarm on this event ? so we get notified if the healthChecks failed... ?
  • healthChecks requests can be captured ? in other words if a health check failed, can we log it using MessageLogging policy ? (using Graylog via UDP)
avatar image Dino-at-Google ♦♦ Chawki MATTA   · Mar 25, 2020 at 06:34 PM 0
Link

No, Apigee does not send alerts when a target server is removed or added from rotation.

Healthchecks cannot be logged in the current Apigee.

This stuff can be done in the next-gen Apigee.

avatar image RakbDigital · Mar 24, 2020 at 02:49 PM 0
Link

@Dino-at-Google @Denis Kalitviansky,

Thanks for your response.

I am facing a challenges here, please help me ,

I have a proxy called "access" . under "access" proxy , multiple flow names login,resetpassword,createPassword with different endpoint and one target server. So please suggest, how can I configure HealthMonitor only on login flow not other flows in that proxy. Please suggest.

avatar image RakbDigital · Mar 25, 2020 at 05:24 AM 0
Link

Hi @Dino-at-Google ,

As per the link you suggested , I added the below code in my proxy target , but looks like its not working.

As per my understanding in the below code , if I am getting http status code either 500 or 503 or 504 from target more than 2 times, then its count as maxfailures is 2.

If its yes its 2 , then as per the HealthMonitor code , my proxy has to be un-deploy and once the target is up , then proxy should be re-deploy with responseCode 200.

If its NO, then please send me the code snippet for correct implementation . My requirement mentioned above in the post.

Please help me.

<LoadBalancer>

<Server name="XXXXXX"/>

<MaxFailures>2</MaxFailures>

<ServerUnhealthyResponse>

<ResponseCode>503</ResponseCode>

<ResponseCode>504</ResponseCode>

<ResponseCode>500</ResponseCode>

</ServerUnhealthyResponse>

</LoadBalancer>

<Path>{targetpath}</Path>

<HealthMonitor>

<IsEnabled>true</IsEnabled>

<IntervalInSec>5</IntervalInSec>

<HTTPMonitor>

<Request>

<ConnectTimeoutInSec>10</ConnectTimeoutInSec>

<SocketReadTimeoutInSec>30</SocketReadTimeoutInSec>

<Port>80</Port>

<Verb>GET</Verb>

<Path>{targetpath}</Path>

</Request>

<SuccessResponse>

<ResponseCode>200</ResponseCode>

<Header name="ImOK">YourOK</Header>

</SuccessResponse>

</HTTPMonitor>

</HealthMonitor>

</HTTPTargetConnection>

avatar image RakbDigital RakbDigital · Mar 25, 2020 at 03:33 PM 0
Link

Hi @Dino-at-Google... any help on this.

avatar image RakbDigital RakbDigital · Mar 30, 2020 at 01:12 PM 0
Link

Hi @Dino-at-Google... any help on this.

Follow this Question

Answers Answers and Comments

140 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 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

Content-Length is not getting populated when backend does not send the length in the header. 1 Answer

How to deploy multiple proxy End points in one proxy? 1 Answer

How to use custom attributes in Apigee Edge? 3 Answers

Circuit breaker in Apigee Public cloud 1 Answer

How did I open this useful modal dialog box in the Apigee Edge "Develop" tab ? 1 Answer

  • 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