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?
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With