{ 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
3

Tutorial : Apigee Edge - Post Client Flow  

  • Export to PDF
Anil Sagar @ Google   created · Feb 11, 2016 at 06:26 AM · 9.3k Views · edited · Mar 03, 2016 at 04:53 PM

Hello Everyone,

In this video, We will see why to use post client flow and how it will impact the performance of an API proxy if you would like to do some processing after sending the response back to the client in API flow.

Why PostClientFlow?

It's implemented to improve the performance of Apigee API proxy. Before this flow, we use to send API Proxy data to analytics in Proxy Post flow. Ideally, this can be done even after sending the data to the client. Now, If you see data is send to AX in PostClientFlow.

How can I use PostClientFlow in my API Proxy?

  • For Message Logging using Message Logging Policy,
    • Similar to sending data to Analytics, you might be using message logging policy in API proxy to log proxy details to syslog / loggly / splunk.
    • If you are implementing message logging policy other than postlclientflow, it's time to move that into postclientflow and improve performance

How to Add PostClientFlow to my API Proxy ?

  • PostClientFlow is supported only in Proxy Response Flow. You can add any policies related to post client flow only in response pipeline.
  • See example XML code below that goes into proxy xml,
<PostClientFlow>

  <Request/>

  <Response>
     <Step>

       <Name>POLICYNAMEGOESHERE</Name>

     </Step>

  </Response>

</PostClientFlow>

Keep us posted if you have any queries.

thub.nodes.view.add-new-comment
edgeapigeemessage logging policy4mv4dpost client flow
Add comment Show 15
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 Alex Koo ♦♦   · Mar 03, 2016 at 04:41 PM 2
Link

Thank you for this informative post, @Anil Sagar-- it's very helpful. I had an important comment: seems I can only use message logging policy in postclientflow. I.e., your statement on allowing the following:

  • Implementing any functionality where you would like to process data after sending back response to the client.

looks to be incorrect. Only message logging is allowed. Please confirm, as there are others who are running into the same confusion.

avatar image Benjamin Goldman Alex Koo ♦♦ · Mar 03, 2016 at 04:43 PM 0
Link

this is my understanding and our experience as well.

avatar image Anil Sagar @ Google ♦♦ Alex Koo ♦♦   · Mar 03, 2016 at 04:54 PM 0
Link

@Alex Koo , @Benjamin Goldman , You are right, My bad, I have updated the text. I hope we get that capability moving forward.

avatar image sanjeev kumar · Apr 06, 2016 at 08:01 AM 0
Link

@Anil Sagar - "Usage notes" section of "Message logging policy" says - "Edge logs message asynchronously, meaning that no latency that might be caused by blocking callouts is introduced to your API."

Is this true only when message logging policy is used inside Post Client Flow (as this video indicates), or it is asynchronous irrespective of location this policy is placed at?

avatar image Anil Sagar @ Google ♦♦ sanjeev kumar   · Apr 06, 2016 at 11:48 AM 0
Link

@sanjeev kumar , Yes, I believe irrespective of location, Message logging policy logs message asynchronously. Time it takes to execute / invoke policy can be saved if same implemented in post client flow. It's always recommended to implement same in POST Client Flow. @arghya das Is that how it works ? Correct me if i am wrong.

avatar image arghya das ♦ Anil Sagar @ Google ♦♦ · Apr 06, 2016 at 03:16 PM 1
Link

@Anil Sagar That's right. The message logging does work asynchronously. But moving it to the post client flow makes it a fraction better since the client response is already sent so any delay in invoking the policy is outside of the actual request/response flow.

Show more comments
avatar image Andrei Filippov · Dec 14, 2016 at 03:11 PM 0
Link

Hi @Anil Sagar,

Thanks a lot for sharing this information!

We have logging implemented in PostSlientFlow. Unfortunately, response body doesn't seem to be available in this flow. Nothing gets printed to the log and trace shows that variable response.content is empty. Any idea how we could log response body? Thank you in advance!

avatar image Anil Sagar @ Google ♦♦ Andrei Filippov   · Dec 14, 2016 at 05:27 PM 0
Link

@Andrei Filippov , Are you oncloud ? How can i reproduce your issue ? Is there a sample proxy bundle ?

I will give it a try & keep you posted. Stay tuned !

avatar image Andrei Filippov Anil Sagar @ Google ♦♦ · Dec 14, 2016 at 07:06 PM 0
Link

Hi @Anil Sagar,

Thanks a lot for getting back to me! No, I'm using on prem version 4.16.01.04.

I posted a copy of my logging policy here

avatar image Krish · May 11, 2017 at 04:30 PM 0
Link

HI @Anil Sagar,

I have a message logging policy in the post client flow. I want to write a response content which is sent to the client in the log. Do you know if apigee has any reference variable I can use in post client which gives the information? I used response.conetnt and message.content, both didn't work.

Thanks.

Krish

avatar image Anil Sagar @ Google ♦♦ Krish   · May 12, 2017 at 02:02 AM 0
Link

@Krish ,

Can you post same as a new question ?

avatar image Ken Lassesen · May 03, 2018 at 07:44 PM 0
Link

I added

<PostClientFlow> <Request/> <Response> <Step> <Name>Python-TokenDelay</Name> </Step> </Response> </PostClientFlow>

And get an error while saving

"Bundle is invalid. Errors:[Entity : PostClientFlow, Script policy is not supported in the response flow;]."

I wish to send a message to a queue in the PostClientFlow (likely by Python or Javascript)...

I prefer not to slow the client response by doing it earlier.

Article

Contributors

avatar image

Follow this article

41 People are following this .

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

Navigation

Tutorial : Apigee Edge - Post Client Flow

Related Articles

Apigee 4MV4D - API Traffic Management : Quota - Series - Introduction to API Traffic Management - S02E01

Apigee 4MV4D - API Traffic Management : Quota - Series - Quota Policy - S02E02

Apigee Edge - 4MV4D - Quota Policy - Distributed & Synchronous - S02E03

Apigee Edge - 4MV4D - Quota Policy - Message Weight - S02E05

Apigee Edge - 4MV4D - Quota Policy - Calendar Type - S02E06

Apigee Edge - 4MV4D - Quota Policy - Rolling Window Type - S02E07

Apigee Edge - 4MV4D - Quota Policy - Flexi Type - S02E08

Apigee Edge - 4MV4D - Quota Policy - Conditional Quota Count - S02E09

Apigee 4MV4D - Programming of APIs - Series - API Proxy Flows - S01E06

Apigee Edge - 4MV4D - Quota Policy - Error Handling - Fault Variables - S02E11

  • 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