Layer7 API Management

  • 1.  Is each individual Gateway node has a different cache or a common cache?

    Posted May 08, 2017 06:28 AM

    Is each individual Gateway node has a different cache or a common cache?

     

    We believe there should be only one common cache. But we have encountered an issue something as explained below. This could be possible only if the individual node has their own cache. 

     

    ---------------------------------------------------

    We have two node gateway cluster. We have a policy with 3rd party system as backend service who authenticates using Auth 2.0 Tokens. 

     


    1. Check if the valid token is available in Cache ('Look Up In Cache').

    2. If valid Token is not available from

    3. Get 3rd Party API Access Token valid for 3559 Secs.

    4. Store token in Cache using assertion 'Store To Cache' with expiry to 3000 Secs.

    5. Call 3rd Party API with valid/updated Token. 

     

    > 3rd Party system can have only one valid token for each API-key at given time.

    Issue:

    Request 1 on Gateway Node 1: 

    1. Look Up token from Node 1 Cache: Not available

    2. Get Access token and stored to cache with expiry to 3000 Secs.Assum Token Values in 'token-one'.

    3. Call 3rd Party API with a valid token. 

     

    Request 2 on Gateway Node 2:

    1. Look Up token from Node 2 Cache: Not available

    2. Get Access token and stored to cache with expiry to 3000 Secs.Assum Token Values in 'token-two'.

     Note: Token 'token-one' generated 

    3. Call 3rd Party API with a valid token.

     

    Request 3 on Gateway Node 1:

    1. Look Up token from Node 1 Cache: ('token-one' is available from Node 1 cache which has already expired in 3rd Party system).

    2.Call 3rd Party API with Invalid token 'token-one'. The 3rd party returns invalid token error.

     

     

    Can someone please confirm if each node will have their cache? If yes then it's an issue as explained above. How to solve this to have a common place to store a token which should be accessible across all gateway nodes. 

     

     

    Regards

    Kareem



  • 2.  Re: Is each individual Gateway node has a different cache or a common cache?

    Broadcom Employee
    Posted May 08, 2017 08:34 AM

    Hi Kareem,

     

    The cache is stored at the node level and is not shared between Gateway nodes. 

     

    Ref:

    Store to Cache Assertion - CA API Gateway - 9.2 - CA Technologies Documentation 

     

    Regards,

    Joe



  • 3.  Re: Is each individual Gateway node has a different cache or a common cache?
    Best Answer

    Posted May 08, 2017 11:49 AM

    There is a Remote Cache assertion that was created by the Tactical team. The Remote Cache Assertion provides support for storing and retrieving messages from Memcached, Coherence, Terracota, GemFire as well as Redis cache servers. This assertion is not provided with the core product, so you would need to open a support ticket to request a copy of this assertion that will work with the version of gateway that you are running.