Asynchonous call an ExtensionCallout Policy

I've used ServiceCallout Policy before in asynchronous mode.

However, I can't find any mentioned of this for ExtensionCallout Policy. Why I wanted to run ExtensionCallout in asynchronous mode is because it's configured for Cloud Logging. 

So I want to call the policy and send out my logs without waiting for any response.

Currently, it took more than 300ms for this policy to execute. Which is not satisfactory since my ServiceCallout Policy in asynchronous mode took less than 1ms.

I've even make the code as simplified as possible.

 

 

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ConnectorCallout name="EC-SendCloudLogging" continueOnError="true" enabled="true">
    <DisplayName>EC-SendCloudLogging</DisplayName>
    <Connector>cloudlogging-ext</Connector>
    <Action>log</Action>
    <Input><![CDATA[{"logName":"proxy-{apiproxy.name}","metadata":{"resource":{"type":"api"}},"message":{public.log_event}}]]></Input>
</ConnectorCallout>

 

 

Any ideas? Or if this was even possible?

Thank you.

 

0 3 92
3 REPLIES 3

The MessageLogging policy supports writing logs to Cloud Logging natively. This feature was released in Nov 2021 (see release notes). Per your requirements, you can also configure MessageLogging policy to run in the PostClientFlow, which occurs asynchronously and does not introduce latency to your overall proxy response time. 

Thanks for this. I'm actually writing to logs via Flowhook. Which is why I needed the policy to be asynchronous.
MessageLogging update do support Cloud Logging it seems. However I'm still on Edge. Will keep this in mind in my future migration.

The Cloud Logging extension can also be used in PostClientFlow. But yes, this means, no flow hook..