API Connect

API Connect

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.


#API Connect
#Applicationintegration
#APIConnect
 View Only
  • 1.  How to call multiple external consumers dynamically

    Posted 12/29/21 02:07 PM
    Dear Team,

    I have a requirement where i want to invoke different consumers using APIConnect.

    Each consumer has different URL, different security standards.

    We need to route dynamically at run time using incoming id which will be unique.

    Best Regards,

    Mohammed Ahmed Siddiqui,
    Senior Integration Developer,
    Riyadh, Saudi Arabia,
    Mobile : +966532461642


  • 2.  RE: How to call multiple external consumers dynamically

    Posted 12/30/21 03:35 AM

    Dear Mohammed,

       By invoking "different consumers" I think you've meant different API providers. 

    Consumers will invoke API Connect as API connect will provide end API. 

    From the APIs themselves, you can invoke external APIs which might have different URLs and 

    security constraints.

    As you know, we have Invoke policy which you might use to invoke external APIs. 

    You would need some kind of routing table so you can route dynamically. You can hard 

    code routing table in the definition of the API (assembly) or use external source as a routing table.

    One easy solution would be to host static JSON, it could be even exposed as API on APIC.
    This JSON would you then use to route request when you recognize to which 
    service it should go. If you need to route by "incoming id" then it looks like 
    you would need to do some DB lookup. So you would build a service that would do the lookup
    (in Java for example) and use the service to return Endpoint address and security constraints.
    With this information, you could then build an appropriate request and call an external API. 

    I hope this helps. 

    All the best,
    Miro




    ------------------------------
    Miroslav Rešetar
    CROZ d.o.o.
    Zagreb
    ------------------------------



  • 3.  RE: How to call multiple external consumers dynamically

    Posted 12/30/21 04:22 AM
    Dear Miro,

    Thanks a lot for your valuable suggestion.

    Let me try it and get you back.

    Regards,
    Ahmed

    ------------------------------
    Mohd Ahmed Siddiqui Senior Integration Developer
    Senior Integration Developer
    Tabadul
    Riyadh
    +966-558642861
    ------------------------------



  • 4.  RE: How to call multiple external consumers dynamically

    Posted 12/30/21 06:22 AM
    Hi.

    My team has that scenario implemented (quite a lot of times actually). 

    We tipically apply two different solutions (according to the requirements, and both are similar to what Miroslav wrote):
    1 - Use the underline datapower capabilities, and create a mapping/routing file in the DataPower system. This routing file could be directly acessed via Gateway script in the API code to decide and retrive the destination URL. Drawback: you will have to maintain the file locally, and if you several machines, you might need to implement a process to maintain that file synced betwwen gateways (we use a jenkins pipeline, but ti can also be done manually. I do not recomend the manual solution)
    2 - Use an external system to maintain the routing information. We use an internal BRM (Bussiness Rules System) that maintain that information. Advantage: we have only one place to update the information (and our BRM solution has a very nice GUI standard interface that helps editing the information. Drawback: is one more call from the API to an external system (although this can/must be minimize by the use of the cache feature in the API Invoke) 

    Hope it helps

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