DataPower

 View Only
  • 1.  DataPower MPGW internal routing

    Posted Thu October 07, 2021 09:07 AM
    Hi guys.

    In our company we have a lot of WebServices (SOAP and Rest) on top of DataPower: several of them are Web Services Proxies implementations, other are on top of MultiProtocol Gateways (MPGW).

    Because of our big number of MPGW, we are starting to struggle in the best way to internally route the requests to the specific MPGW. Trying to explain with an example:
    • Consider for starters that all of our services are exposed on the internet address www.example.com
    • This address is translated to our DataPower to port :443
    • This port is assigned with an HTTP Handler that in term is assigned to generic MPGW 
    • In this generic MPGW we have a huge routing xslt file, that by considering the URI from the request, redirects to a specific MPGW.
    • This redirect is based on a internal port (another HTTP Handler) assigned to the specific MPGW
    Code example:
    <xsl:when test="regexp:match($URI,'^/URI1/test1/V1$','')">
        <dp:set-variable name="'var://service/routing-url'" value="'http://127.0.0.1:610/new-URI1/new-test1/V1'"/>
    </xsl:when>
    <xsl:when test="regexp:match($URI,'^/URI2/test2/V1$','')">
        <dp:set-variable name="'var://service/routing-url'" value="'http://127.0.0.1:611/new-URI2/new-test2/V1'"/>
    </xsl:when>
    <xsl:when test="regexp:match($URI,'^/URI3/test3/V1$','')">
        <dp:set-variable name="'var://service/routing-url'" value="'http://127.0.0.1:612/new-URI3/new-test3/V1'"/>
    </xsl:when>


    Notice the internal ports 610, 611, 612.

    You can imagine that is starting to get difficult to manage: handling all the of MPGW, with the necessary HTTP Listeners and constant different internal ports.

    Question: is there a better way to do this? We've looked on the possibility to use the "Call processing rule action" in the policy. Will this be a good solution? Any other ways out to there to better govern this?

    Thanks in advance
    Cheers

    ------------------------------
    Tiago Soares
    ------------------------------


  • 2.  RE: DataPower MPGW internal routing

    Posted Thu October 07, 2021 09:26 AM
    Rather than using a large XSLT to perform the routing, perhaps look into a large XML routing file. You can then use an XPATH to select the correct destination. This practice of using an XML file rather than an XSLT is a common practice. This way you can have different XML files for each of your environments.
    --Charlie

    ------------------------------
    Charlie Sumner
    ------------------------------



  • 3.  RE: DataPower MPGW internal routing

    Posted Fri October 08, 2021 11:49 AM
    Thanks Charlie for your note. In fact is something that we already thought in doing.

    But is this way (routing to a given internal port number that is associated with an MPGW) the best way? Is there any other way? I have a background in other technologies, and in this point, I think it would other better solutions...

    ------------------------------
    Tiago Soares
    ------------------------------



  • 4.  RE: DataPower MPGW internal routing

    Posted Fri October 08, 2021 05:00 PM

    So the best practice is not to chain services. How complex are each of the internally routed MPGW services. Could they all be consolidated into one service with a slew of processing rules using match actions to select the Rule by URI? From a performance perspective the payload only needs to be parsed once. But the selection process is sequential. Using the XML file is probably the most efficient as the selection process is direct using XPATH. 

    There are pros and cons to both methods.  But using the XML file I would say is the most common and easiest to manage. 



    ------------------------------
    Charlie Sumner
    ------------------------------