Layer7 API Management

  • 1.  CA proxy connection to external database

    Posted Mar 26, 2019 08:09 AM

    Hello, 

     

    Could you please guide me on how to store the proxy response in an external database and retrieve the same?

     

    If any user is authenticated, I need to fetch the related data from external database rather than making a fresh call to business service.

     

    I am using CA api gateway 9.4.00

     

     

    Appreciate the response.

     

    Thanks,

    Pramod



  • 2.  Re: CA proxy connection to external database

    Broadcom Employee
    Posted Mar 26, 2019 05:54 PM

    Dear Pramod.Talekar ,

    I believe you're talking about caching the response, we can use "store to cache"/"lookup in cache" assertions for that,

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

    Look Up in Cache Assertion - CA API Gateway - 9.4 - CA Technologies Documentation 

     

    it's much faster than caching to external database.

     

    As it caches in memory, it's local cache, if you need cluster wide caching, there is RemoteCache tactical assertion,  you need to open a support ticket for tactical assertion.

     

    If you have to save to database, you  can add jdbc connection(Manage JDBC Connections - CA API Gateway - 9.4 - CA Technologies Documentation ), and then use Perform jdbc query assertion (Perform JDBC Query Assertion - CA API Gateway - 9.4 - CA Technologies Documentation ) to submit DB operations.

     

    Regards,

    Mark



  • 3.  Re: CA proxy connection to external database

    Posted Mar 27, 2019 12:38 PM

    Hi Mark, 

     

    Thanks for the suggestion, I need to perform some testing on DB before deciding on caching mechanism.

     

    In the Perform jdbc query assertion, I wrote select * from schema1.table1 where userId = ${testUserId};

     

    However, I get can not use context variable message while trying to test it.

     

    Could you please suggest on this.

     

    Regards,

    Pramod



  • 4.  Re: CA proxy connection to external database

    Posted Mar 27, 2019 01:20 PM

    The actual error message is below.

     



  • 5.  Re: CA proxy connection to external database

    Posted Mar 27, 2019 02:37 PM



  • 6.  Re: CA proxy connection to external database
    Best Answer

    Posted Mar 27, 2019 02:54 PM

    I'm able to solve it now.

    The Test button when clicked throws error, so I closed  this alert box, the proxy works fine.

     

    Thanks,

    Pramod