How does router determine it has to send a requst to correct Message Processor?

Hi Team,

I am taking a use case

In a gateway pod, I have three router R1, R2 and R3 and I have three MPs, MP1 , MP2 and MP3.

I have two environments in ORG1 ie ENV1 and ENV2.

ENV1 is associated to MP1 and MP2. and ENV2 is associated to all the three MP's.

Now if the request for API PROXY deployed to ENV1 comes to Router1, how does the router determines it should not send request to MP3.

Also, in apigee version 4.16 using NGINX router where the classification ie ORG, ENV, API PROXY,etc occurs at MP and it does not occur at Router(ie older version of router Netty).

How will this affect the use case that I have just explained above?

Please reply soon.

Thanks and Regards,

Gaurav Bhandari

0 7 738
7 REPLIES 7

Host header of the request is how the routing is determined. Not sure that version really impacts that.

Hi Carlos,

The consumer are going to send the request using the VIP and not by providing the IP address of the router.

Also, the router can send message to any message processor within the same POD.

Hence, how does router determine that the proxy A is deployed in MP1 and Proxy B is deployed in MP2.

Thanks and Regards,

Gaurav Bhandari

environments are associated with MPs, so that's where that mapping happens. If a proxy is deployed to environment X and environment X is associated with MPs 1 and 2 then those will handle the request.

@Carlos Eberhardt

That's exactly correct. But my point is, how does router determines which MP the request should go.

For example,

Three routers R1,R2 and R3 and Three MP1, Mp2 and MP3.

The Proxy A is deployed in MP1(ie env global and MP1 is registered to global) and Proxy B is deployed in MP2 and MP3(ie ENV Internal as MP2 and MP3 are registered to internal)

Now request for proxy B comes to router R1. Now how does router R1 knows that it has to send request to either MP2 or MP3 and it should not send request to MP1.

In more detail... the Edge router is implemented by nginx, and when you (as administrator) define an environment and add MPs into it, then define a vhost with a specific alias, then Apigee Edge generates a specific rule for nginx that tells it to route inbound requests for that vhost to the appropriate set of MPs. If you add an MP or remove an MP from the set, then Apigee Edge modifies the rule for nginx.

If you want to know more about the "how", then I suggest that you examine the nginx configuration files in your OPDK installation. Remember: These are generated config files; you cannot modify them and expect Apigee Edge to pick up your custom changes.

Hi Dino,

Thank you for your response. This means that NGIX router exactly knows which MP it has to send message.

Hi @Dino,

Can you please answer?