why flow hooks does not support for post client flow

Hi ,

We created logging shared flow as a framework and want execute for all proxies without attaching to proxies in the Org. During this process , we tried to attach logging shared flow to flow hooks.

we don’t see any post client flow for flow hooks.

So could you please anybody help me and explain why this limitation and any alternative for this without touching actual proxies.

Thanks & Regards,

Ranganath

2 7 1,178
7 REPLIES 7

Can you check some other community post which suggests it may be just the UI issue.

https://community.apigee.com/questions/44926/why-shared-flow-is-not-supported-in-postclientflow.html

A PostClientFlow can include only MessageLogging policies. If you include one, a PostClientFlow would be the last flow to execute, executing after a response is sent to the client.

Please find more details about PostClient Flow:

https://community.apigee.com/content/kbentry/18196/tutorial-apigee-edge-post-client-flow.html

Thank you Rajesh for your response.

We have some scenarios to execute at post client flow . Not just message logging policy.

Is there any alternative to fulfill this requirement. Or any future release include this functionality.

Not applicable

I asked an expert and they said there is no support for post-client flow hooks. 😞 Which is really silly because messaging policies are supposed to be executed at PostClientFlow time, and you'd mostly want a messaging policy to be global...

There is a workaround for post client flow flow hook-

Create a Shared Flow - Global-Post-Client-Flow

Add a servicecallout policy to the shared flow which will call a proxy(loggerproxy) having a post client flow.

Add a condition to skip servicecallout policy (SC-CallSplunkLogger) for loggerproxy

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<SharedFlow name="default">
<Step>
<Name>SC-CallSplunkLogger</Name>
<Condition>apiproxy.name != "loggerproxy"</Condition> <!-- This condition is important to avoid infinite loop -->
</Step>
</SharedFlow>

 

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ServiceCallout async="false" continueOnError="false" enabled="true" name="SC-CallSplunkLogger">
<DisplayName>SC-CallSplunkLogger</DisplayName>
<Properties/>
<Request clearPayload="true" variable="myRequest">
<IgnoreUnresolvedVariables>false</IgnoreUnresolvedVariables>
</Request>
<Response>calloutResponse</Response>
<LocalTargetConnection>
<Path>/splunk/data/input</Path>
</LocalTargetConnection>
</ServiceCallout>

Create the loggerproxy add a post client flow with a servicecallout policy for splunk or  use pubsub connectors  to log or ad whatever you want to execute in the post client flow.

 <PostClientFlow name="postclientflow">
<Request/>
<Response>
<Step>
<Name>Global-Splunk-Flow</Name>
</Step>
</Response>
</PostClientFlow>
<HTTPProxyConnection>
<BasePath>/splunk/data/input</BasePath>
<VirtualHost>secure</VirtualHost>
</HTTPProxyConnection>
<RouteRule name="noroute"/>
</ProxyEndpoint>

Add the Global-Post-Client-Flow to postflow flow hook.

This is a reasonable workaround.

Also, for the future, the team is looking at enabling a Postclient Flow hook. 

Add the Global-Post-Client-Flow to postflow flow hook.

One major reason why Apigee customers want to log a message on the post-client flow as opposed to the post-flow is so that when there's an error in the proxy, logging will still occur (that's a feature of the post-client flow). If we were to call Global-Post-Client-Flow within a post-flow as is suggested here, Global-Post-Client-Flow won't run if there's an error in the proxy, resulting in a message never getting logged.

hi... any updates on enabling postclient flow hook in Apigee Hybrid ?