New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optionally announce server location on startup #241

Closed
scosenza opened this Issue Sep 8, 2015 · 6 comments

Comments

3 participants
@scosenza
Contributor

scosenza commented Sep 8, 2015

Thank you @thirstycrow for reporting this.

Internally at Twitter, Aurora announces our services, but we should make announcing configurable for non-Aurora deployments. We'll need to update BaseHttpServer to optionally use the Httpx.serveAndAnnounce method.

@cacoco cacoco added the backlog label Sep 14, 2015

@raviv

This comment has been minimized.

raviv commented Jan 10, 2016

+1

@cacoco

This comment has been minimized.

Member

cacoco commented Jan 15, 2016

Http server announcing is supported by setting the http.annnounce or https.announce flags. See BaseHttpServer. Thrift support is forthcoming (done in internal codebase will be merged on next code sync to Github).

@raviv

This comment has been minimized.

raviv commented Jan 16, 2016

@cacoco, since httpAnnounceFlag is private and doesn't have a protected default value, like other flag do, the only way to set it is through command like flag (please correct me if I'm wrong here).
I think it makes sense to add a default value to it as I rather set the announce string from code, rather than command line.

Somewhat related to that, is there a way to announce two services running on the same process and port?

@cacoco

This comment has been minimized.

Member

cacoco commented Jan 18, 2016

@raviv we would not be able to provide any meaningful default here (and it would trigger announcing; which we don't want to happen by default) unless a meaningless sentinel value were checked. In the spirit of keeping it simple the flags are implemented without defaults.

With that, due to how private works in Scala you could override the val if you really wanted to.

For your follow-up question, I don't know how two services could work trying to bind to the same port, so I don't think announcing would work either.

Thanks!

@raviv

This comment has been minimized.

raviv commented Jan 19, 2016

@cacoco re:two service, I'm referring to the scenario where I have ServiceA and ServiceB which I expose as REST API through ControllerA and ControllerB, both part of one HttpServer running on the same port of course.
ServiceA's URL is /ServiceA/ActionX, etc.
ServiceB's URL is /ServiceA/ActionY, etc.

I don't think it's uncommon to run more than one logical service in one process.

@cacoco

This comment has been minimized.

Member

cacoco commented Jan 19, 2016

@raviv sounds good. I think there's sometimes conflation with services and servers. We typically talk in a 1:1 between service and server. So my comment was around servers.

Back to your original question, since we equate one service to one server you wouldn't be able to announce more than one logical server with the current code. The announcement flag is interpreted as a single forum to announce against the bound address. With that, though, you can announce http and https endpoints separately. Hopefully that helps. Thanks!

@cacoco cacoco closed this Jan 23, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment