Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

cloud foundry intra-application communication

I have 3 applications running in a private vcap instance. One acts as a customer facing web-app, while the others are backend systems, one exposing data services over REST which the web-app consumes, and another application which asynchronously writes to database through rabbitmq.

Now, my questions are:

1) Instead of the customer facing webapp call a public URL, how can I communicate directly to the rest urls?

2) How do I bind the webapp and the database writer application to the same rabbit instance. I will opt out of auto reconfiguration, but how do i get the rabbit connection parameters?

like image 605
tanmoy Avatar asked Nov 03 '22 01:11

tanmoy


1 Answers

I'm going to answer these the other way round! You can bind the application by inspecting the VCAP_SERVICES environment variable, this will have the details of the bound Rabbit instance.

When you deploy an instance of an application, it's started up on a VM (called a DEA). The application instance is assigned a port on the VM. Internally, all DEAs can "see" each other so there is no reason why an application shouldn't be able to talk on a private IP address to another application running on a different DEA.

Obviously you don't know what private IP address or even port an application will live on until is has been pushed, so I would suggest you have each application "register" it's address via Rabbit after it's been pushed so the other applications can find it.

like image 87
Dan Higham Avatar answered Nov 13 '22 05:11

Dan Higham