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

Latest commit

 

History

History
34 lines (23 loc) · 806 Bytes

service-discovery.adoc

File metadata and controls

34 lines (23 loc) · 806 Bytes

Service Discovery

  1. Maven Dependency

    <dependency>
       <groupId>eu.agilejava</groupId>
       <artifactId>snoop-client</artifactId>
       <version>${snoop.version}/version>
    </dependency>
  2. Configure the client

    1. Using snoop.yml

      snoop:
        snoopService: 192.168.59.103:8081/snoop-service/
    2. Or by environment variable

      docker run -it -p 8080:8080 -e "snoopService=192.168.59.103:8081/snoop-service/" ivargrimstad/snoop-helloworld:1.0.0-SNAPSHOT
    3. Or by system property

      -DsnoopService=192.168.59.103:8081/snoop-service/
  3. To discover a service, use the @Snoop qualifier to inject a client to the registered service.

    @Inject
    @Snoop(serviceName = "hello")
    private SnoopDiscoveryClient helloService;
  4. Consume the Service