Routing of an app user's request

24 views
Skip to first unread message

Ignacio Silva-Lepe

unread,
Apr 6, 2013, 2:30:19 PM4/6/13
to vcap...@cloudfoundry.org
Basic question, when a request is made on an app by a user (say, "curl env.vcap.me), does the message that gets routed to the corresponding droplet/app flow via NATS? Or is there a dedicated channel that the router uses to invoke the app without using NATS at all?

Thanks

Luke Bakken

unread,
Apr 7, 2013, 11:22:23 AM4/7/13
to vcap...@cloudfoundry.org
The router keeps track of what DEA servers are hosting an application, and on what port. That way it can just forward the HTTP requests directly for a request like your example.

NATS is used by the DEA during droplet deployment to announce a running application on a dedicated port. The router then uses this information to update its internal information.

Ignacio Silva-Lepe

unread,
Apr 7, 2013, 12:01:49 PM4/7/13
to vcap...@cloudfoundry.org
I see, so the router does keep its own routing table. Would it be fair to assume that the router then uses some protocol (e.g., REST) over http to invoke the apps, as opposed to whatever protocol NATS uses?

Thanks

Dave Syer

unread,
Apr 8, 2013, 3:21:09 AM4/8/13
to vcap...@cloudfoundry.org
On 07/04/13 17:01, Ignacio Silva-Lepe wrote:
> Would it be fair to assume that the router then uses some protocol
> (e.g., REST) over http to invoke the apps, as opposed to whatever
> protocol NATS uses?

The router is a simple HTTP proxy. It doesn't change the protocol of
the incoming HTTP requests (only enhancing the headers), nor does it
currently support other incoming protocols.

--
Dave Syer
ds...@vmware.com

Ignacio Silva-Lepe

unread,
Apr 8, 2013, 9:54:12 AM4/8/13
to vcap...@cloudfoundry.org
Ok, great, thanks for your input. What I'd like to do is to intercept the request as it is being routed to the app. Currently I am browsing through the router code, but any pointers at where to look in particular would be much appreciated.

Thanks
Reply all
Reply to author
Forward
0 new messages