Adding a Service Callout to PostClientFlow

sunin_shah
Participant II

I have added a service callout to log to splunk in the post client flow of my proxy and somehow successfully managed to save it. I subsequently changed this to enter some meaningful details for host name, port number, message I want to log etc and tried to save again. This time I got an error saving my revision of the proxy. I have a few questions:

1.Why this inconsistent behaviour? Reading the apigee documentation, I would have expected this to fail every time as only message logging policy is accepted in post client flow.

2. Why have such a restriction. I want the flexibility to log -- not only to syslog, but also to a splunk HTTP event collector or for that matter to any endpoint I choose. At the moment, the message logging policy only allows syslog.

3. What other logging option are there for a public cloud?

0 9 1,253
9 REPLIES 9

adas
Participant V

@Sunin Shah Let me try to answer these questions one by one. Here it goes:

1. I tried this out myself on our cloud and I get this error consistently, "messaging.config.beans.InvalidBundle. Errors:[Entity : PostClientFlow, ServiceCallout policy is not supported in the response flow;]." So I would like to see how you managed to save the service callout in the post client flow. If you can share the bundle with me, that would be great. You can email me at adas@apigee.com

2. The restriction was imposed, keeping in mind that the only meaningful activity that you might want to perform in the post client flow was logging. And like you mentioned the message logging currently supports only allows syslog. You can still log to splunk over http using a service callout but like you already found out that's not possible in the post client flow. For details of logging to splunk, refer to the arcticle here. I will take your feedback and share this with my team to see if we can do something to enable other policies in the post client flow. I am afraid that would be treated as a feature request and I won't be able to share an ETA for it.

3. As of now these are the only options available for public cloud. For help, please refer to our docs site for message logging policy here

Thanks @arghya das. I have sent you the project and a screenshot of trace through the proxy.

For the second item, I only want to perform logging in the post client flow - but without the restriction. You could either enable other policies in the post client flow, or extend the message logging policy to allow for logging to other endpoints. I think this would be an extremely useful thing to have as it is not always possible or desirable to configure syslog endpoints (and/or Splunk forwarders to handle syslog events).

Let me know your thoughts.

@Sunin Shah

I do agree that allowing few extra policies in the post client flow would be super useful. I created a feature request for it, where I specified the "extension" policies should be supported. The extension policies are:

1. java callout

2. service callout

3. javascript callout

4. python callout

5. message logging

6. stats collector

I believe as long as these are supported you could do all string manipulations, variable assignments, conditions, dynamic evaluations etc. Please note that all the flow variables that Apigee exposes in the runtime, may not be available in the post client flow. At this time, I don't have an ETA on the feature or if at all we are going to do this in the near future. So not making any promises, but I do agree with you in theory and want this to be supported in future.

@arghya das I sent an e-mail to you on 29th. Please let me know if you received it and whether it was helpful.

@Sunin Shah I don't see any such email. Can you please resend it. What subject line or from email should I look for, if I were to go and check my Spam folder.

Please share the information if there is a way to use service call out in post client flow..I have a common logging proxy which I want to call via service callout for different proxies.

Hi Vinay,

Currently Apigee only supports message logging policy in the post client flow and not any other policy as of now.

Thanks,

Santosh

@arghya das The subject line is "Service Callout in Post Client Flow". It was sent on the 29th with two attachments (a zip file of the project and a screenshot of trace through the proxy flow). I have resent it.

@Sunin Shah I honestly can't find it. I went through my spam folder too, nothing there. Would you mind forwarding that again to adas@apigee.com please.