Last active
September 4, 2017 20:02
-
-
Save ivargrimstad/34bfe4b5368a35d30007 to your computer and use it in GitHub Desktop.
Microservices in Java - Snoop example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@EnableSnoopClient(serviceName = "hello") | |
@ApplicationPath("/") | |
public class ApplicationConfig extends Application { | |
@Override | |
public Set<Class<?>> getClasses() { | |
Set<Class<?>> resources = new HashSet<>(); | |
resources.add(HelloResource.class); | |
return resources; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Path("hello") | |
public class HelloResource { | |
@GET | |
public Response greet() { | |
return Response.ok("Hello World").build(); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<dependencies> | |
<dependency> | |
<groupId>javax</groupId> | |
<artifactId>javaee-web-api</artifactId> | |
<version>7.0</version> | |
<scope>provided</scope> | |
</dependency> | |
<dependency> | |
<groupId>eu.agilejava</groupId> | |
<artifactId>snoop</artifactId> | |
<version>${snoop.version}</version> | |
</dependency> | |
</dependencies> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment