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

Anil Sagar @ Google   suggested an idea · Mar 03, 2016 at 04:38 AM · 1.1k Views javascriptpost client flow

JS Policy support for post client flow

thub.nodes.view.add-new-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 Gagandeep Singh · Aug 02, 2019 at 11:48 PM 0
Link

I Agree.

Most of the implementations have custom logging requirements and just message logging policy is not sufficient.

Message Logging policy is used along with JavaScript/Java policy to build the log message(in required format) and then passing the log message string to Message Logging policy. If JS policy is available in post client flow, it will definitely reduce the latency for API Request.

2 comments

· Add your answer
avatar image
3

arghya das commented · Mar 05, 2016 at 05:04 AM

@Anil Sagar I am not sure what sort of a usecase you have in mind for javascript policy post client flow. The postclient flow was introduced so that, we can perform message logging without impacting the actual request response flow. I agree that we can leverage that for other things in the postclientflow, but remember that some of the context variables may not be available in the postclientflow, so having javascript support or other policies there would have limited functionality.

thub.nodes.view.add-new-comment
Add comment Show 2
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 Krish · Apr 26, 2017 at 06:53 PM 1
Link

@arghya das, @Anil Sagar there is a real need of support of javascript in post client flow. Let me give you an example.

I want to log some details(timestamps) in the log file in ISO format. But all the timestamp variables doen't give the required details. So I have to add javascript to convert milisec to ISO format time. How can I achieve this without javascript support. Here is the list of variables i want log.

target.sent.end.timestamp

client.sent.end.timestamp

client.received.start.timestamp

target.received.start.timestamp

Let me know if you have any answer of this.

Thanks,

Krish

avatar image Chawki MATTA Krish · Aug 02, 2019 at 02:07 PM 0
Link

Add a JS policy in the PostFlow response

var start = context.getVariable('client.received.start.timestamp');
var end = context.getVariable('system.timestamp');
var processTime = Math.floor(end - start);
context.setVariable('processTime',processTime);

Post a comment

Up to 2 attachments (including images) can be used with a maximum of 5.0 MB each and 25.0 MB total.

Your Opinion Counts

Help us make things better. Share your great idea or vote for other people's.

Sign in to post a new idea

Follow This Idea

20 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

Related Ideas

  • 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