Region Flow variable to differentiate between two locations in two orgs

Not applicable

Hi, I have a requirement to route the traffic into a particular org. Suppose, I have two orgs i.e org1 and org2. Org1 organization refers to US traffic and Org2 organization refers to UK traffic. Now we have all setup in Org1 means 20 proxies are deployed and everything is working fine in Test and Prod environments too.

Now, we would like to deploy the same proxies into Org2 also. But question here is target URL. How I can route UK based traffic to Org2 and US based traffic to Org1 with in a single proxy? like if region is US then US default flow else if region is EMEA then EMEA default flow.

Is there any variable to fit to this logic? I mean Is there any region flow variable to differentiate between to two locations in two different orgs.

Thanks in Advance!

0 4 345
4 REPLIES 4

sarthak
Participant V

HI @Swapna In your case the two Orgs are completely separate. So the proxies are treated as different proxies.

The business logic in the proxy may be same but since the proxies are deployed in two different orgs Apigee treats them as two different proxies.

Now how do you change the target URL there can be a few different ways:

1. Change it during build time using maven plugin.

2. Use target Servers. That way you do not have to hardcode the target servers inside a proxy.

This is assuming the two orgs are separate. Or you will have same org spanning both regions?

Thanks @sarthak. Yes we have two different orgs but we don't want to maintain two different proxies in the repository. So wanted to modify logic in the existing proxy logic.

Do you have any sample to change URL in build time using maven plugin? Thanks!

You can configure target URLs in config.json as defined here

ok thanks @sarthak. We have a configuration based on org not based on environment. At the time of maven build and deployment it is using these org names to deploy it into specific orgs.

Example: {

"configurations":[

{

"name":"swapnaadusu07",

"policies":[ ], "proxies":[ ] , "targets":[ ]

},

{ "name":"mkbace11",

"policies":[ ], "proxies":[ ] , "targets":[ ]

}

]

}

Also, we have a default and custom route rules defined under target url's. So present we have total 4 target end-points for Org1 for Test and Prod env's.

In this case, any idea what is the better way to define Org2 target end-point? Thanks!