Skip to content
This repository has been archived by the owner on Oct 22, 2018. It is now read-only.

Latest commit

 

History

History
37 lines (27 loc) · 1011 Bytes

service-registration.adoc

File metadata and controls

37 lines (27 loc) · 1011 Bytes

Service Registration

  1. Maven Dependency

    <dependency>
       <groupId>eu.agilejava</groupId>
       <artifactId>snoop</artifactId>
       <version>${snoop.version}</version>
    </dependency>
  2. Enable Snoop

     @EnableSnoopClient(serviceName="myservice")
     @ApplicationPath("api")
     public class ApplicationConfig extends Application {
       ...
     }
  3. Configure the service

    1. Use snoop.yml

      snoop:
        host: http://localhost
        port: 8080
        serviceRoot: snoop-hello-service/api
        snoopService: 192.168.59.103:8081/snoop-service/
    2. Or by environment variables (remember prefix with service name)

      docker run -it -p 8080:8080 -e "hello.host=http://192.168.59.103" -e "hello.port=8080" -e "hello.serviceRoot=snoop-hello-service/api" -e "hello.snoopService=192.168.59.103:8081/snoop-service/" ivargrimstad/snoop-hello
    3. Or by system property

      -Dhost=http://192.168.59.103 -Dport=8080 -DserviceRoot=snoop-hello-service/api -DsnoopService: 192.168.59.103:8081/snoop-service/