Is it safe for the TargetEndpoint to call back into Apigee?

Not applicable

I've seen a lot of conversion on proxy chaining and proxy logic reuse,

but I've never seen anything on whether it's a best practice for target endpoints to callback into Apigee. Looking for guidance here.

consider a proxy endpoint that is exposed from Apigee and we loop back into Apigee from the target endpoint.

0 4 285
4 REPLIES 4

@Zameer Andani , I would suggest using proxy chaining, You can find more about same in this article here.

Use below instead of HTTPTargetConnection,

 <LocalTargetConnection>
        <APIProxy>apigee-target</APIProxy>
        <ProxyEndpoint>default</ProxyEndpoint>
    </LocalTargetConnection>

thanks @Anil Sagar

I think LocalTargetConnection is to be used only when an Apigee Proxy is calling another Apigee Proxy.

My question is more of a target server calling back into Apigee. For example:

client request --> API Proxy 1 --> HTTPTargetConnection 1 --> Target Server 1 --> API Proxy 2 --> HTTPTargetConnection 2 --> TargetServer 2

Is this a best practice, or should my server code in Target Server 1 (outside of Apigee) call directly TargetServer 2

Hi @Zameer Andani, I would like to know if you are calling the services of same Target server which are some way wrapped in Apigee Proxy, if so then it would be better to call the same services directly from your target server and do the processing there rather than going through Apigee.

But again it would depend on the scenario whether you have done some integration with other Target servers or did some mash-up and massaging of data in your Apigee proxy then it would be good to go with calling back to the Apigee proxy.

Another case where you might consider adding this extra latency over business need is capturing the analytical data which Apigee provides through its API.

Best practice is to keep your API layer as light as possible without burdening it with any business logic. So as long as services are on the same target server and it is possible to use them, may be with a little bit of extra coding then it makes sense to use them directly as it will reduce the impact of network latency of going through Apigee's execution life cycle.

Again finding a balance is always a key aspect in making a decision to where to put the code.

Hope this helps!

Thanks @Mohammed Zuber

I am looking at my target server calling endpoints that sit on other servers.

my concerns around looping back into Apigee (private cloud) would be scale;

If my target servers make use of n services that reside on other servers then I would be taking up n+1 threads in my message processors.