On Monday, January 21, 2013 1:58:26 PM UTC+1, Olve Hansen wrote:
> Hi Morten.
> Got the answer - basically you have to implement ServerLifecycleListener
> and via environment object available in the service run-method you add your
> implementation to enviornment:
> ServerLifecycleListener:
> *environment.addServerLifecycleListener(yourHandler);*
> In the event you can query the *Server* object given through * public
> void serverStarted(Server server) *
> There are two connectors, one name "*internal*", and one named "*main*".
> Regards,
> Olve
> On Monday, January 21, 2013 9:38:54 AM UTC+1, Morten Kjetland wrote:
>> Hi,
>> If configuring http.port = 0, Dropwizard will automatically pick a random
>> port.
>> How can I resolve which port was chosen?
>> I'm creating a DDSL plugin for Dropwizard (
>> https://github.com/mbknor/ddsl-dropwizard) which makes it easy to enable
>> Service Discovery to Dropwizard apps.
>> The plugin will resolve the URL your service is currently running on and
>> announce it to DDSL along with service name and version.
>> Other apps / nginx'es etc can then automatically discover it.
>> This plugin is still work-in-progress.
>> Best regards,
>> Morten Kjetland
>> On Sat, Nov 10, 2012 at 4:56 AM, Michael Fairley <michael...@gmail.com>wrote:
>>> The Configuration object that gets passed to the Service's initialize
>>> method contains an HttpConfiguration, which contains the port that the
>>> service will start on.
>>> Managed objects (
>>> http://dropwizard.codahale.com/manual/core/#managed-objects) are bound
>>> to the lifecycle of the service, and can be added to the Environment with
>>> Environment#manage(Managed managed).
>>> On Fri, Nov 9, 2012 at 6:41 PM, Morten Kjetland <morten....@gmail.com>wrote:
>>>> Hi,
>>>> I am the author of DDSL - Dynamic Distributed Service Locator -
>>>> https://github.com/mbknor/ddsl
>>>> DDSL makes it really easy for services to discover/connect to each
>>>> other in a distributed way without any single point of failure using Apache
>>>> Zookeeper.
>>>> DDSL enables an applications/services to register its pressens on the
>>>> "network" when it starts up, and when it quits or it crashes etc, it will
>>>> automatically be deregistered.
>>>> DDSL handles multiple instances of the same app, even with different
>>>> versions at the same time.
>>>> When a service/app needs to connect to a different service/app, it can
>>>> just query DDSL for one or all pressent instances of that specific service
>>>> (with specific version).
>>>> DDSL has a built in distributed load balancer, but you can also set up
>>>> auto-configuration of nginx, apache, ELB etc by using
>>>> https://github.com/mbknor/ddslConfigWriter
>>>> I have already created a Play Framework plugin that makes it really
>>>> easy to register with / using DDSL:
>>>> https://github.com/mbknor/ddsl-play2-module
>>>> I am now looking into creating a similar plugin/module for dropwizard.
>>>> To do this, I have to resolve which URL the app/service is available on.
>>>> So my question to this group is therefor:
>>>> * How can I resolve the http port used.
>>>> * Where/how should I hook in to get a callback when the service goes
>>>> online and offline.
>>>> Best regards,
>>>> Morten Kjetland