DataPower

 View Only
  • 1.  Invoke Gateway script action in Asynchronous mode

    Posted Mon May 27, 2024 05:57 PM

    Hi,

    We got a requirement where we need to log request and response payloads by calling an API asynchronously.

    We have the logic written using gateway script and need to invoke Gateway script action in asynchronous mode. But I don't see async option available for Gatweway script action. The async option seems to be available only for Transform action(xsl).

    Is there any alternate way to achieve this?



    ------------------------------
    Sudarshan Bandaru
    ------------------------------


  • 2.  RE: Invoke Gateway script action in Asynchronous mode

    Posted Tue May 28, 2024 12:33 AM

    Yes you can still achieve async destination url invoke, using urlopen module using Gatewayscript.

    https://www.ibm.com/docs/en/datapower-gateway/10.5.0?topic=apis-urlopen-module



    ------------------------------
    Jayprakash Yadav
    ------------------------------



  • 3.  RE: Invoke Gateway script action in Asynchronous mode

    Posted Wed May 29, 2024 01:04 PM

    To be clear GatewayScript inside the script itself can run functions asynchronously.  That does not mean that it is running asynchronously on the processing rule it resides on -- that is the asynchronous property in the action that allows you to run a transformation and then continue onto the next one, while the first processes asynchronously.

    The solution I think would be to use dp:gatewayscript to call the JS file from a asynchronous XSLT action: https://github.com/ibm-datapower/datapower-samples/blob/master/gatewayscript/example-ext-func-dp-gwscript.xsl

    I am investigating into GatewayScript and the asynchronous property (it is not exposed in the UI, but in other interfaces like SOMA/CLI).  I will update here when I have more information.



    ------------------------------
    DOMINIC MICALE
    ------------------------------



  • 4.  RE: Invoke Gateway script action in Asynchronous mode

    Posted 20 days ago

    To update from an official standpoint on the GatewayScript action. The general recommendation is that asynchronous 'on' at the action level not be used in GatewayScript despite the ability to force it on in the configuration.  The UI does not expose the "asynchronous" option specifically for GatewayScript actions and while it can be set via CLI or SOMA for example, development would recommend that GatewayScript use only synchronous.

    Should anyone be interested in support for GatewayScript asynchronous it is recommended a feature request be filed or voted on for development's consideration at https://integration-development.ideas.ibm.com/ideas -- to note that any consideration of GatewayScript action having asynchronous support would be in a future release.



    ------------------------------
    DOMINIC MICALE
    ------------------------------