Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Meet Snoop - A Discovery Service for Java EE @ ...

ivargrimstad
November 07, 2015

Meet Snoop - A Discovery Service for Java EE @ JavaDayKiev 2015

Architectures based on microservices are increasing in popularity and the most common way of building them is as standalone applications using embedded container or no container at all. What we seem to forget is that microservices are not necessarily small or simple and we often end up creating the boilerplate infrastructure needed that we used to get from the container.

In this session I will show how you can use Java EE technologies to help cope with the inherent complexity of microservice-oriented architectures and thereby benefit from the full potential of the platform.

A common pattern when building systems based on distributed services is Service Discovery. And that is where Snoop comes in. It is a 100% Java EE alternative to Eureka. Just as simple and at least as powerful. And no need for 3rd party frameworks.

The slides for this session will be backed up by a demo to show key concepts and tools.
The demo will use core technologies of the Java EE platform, such as CDI Extensions, WebSockets, JAX-RS and even use MVC 1.0 (JSR 371).

ivargrimstad

November 07, 2015
Tweet

More Decks by ivargrimstad

Other Decks in Programming

Transcript

  1. @ivar_grimstad JavaDay 2015 Meet Snoop Ivar Grimstad Principal Consultant, Cybercom

    Sweden JCP Expert Group Member (JSRs 368, 371, 375) A Discovery Service for Java EE
  2. @ivar_grimstad JavaDay 2015 Service A Service B Service C Application

    Discovery Service Register Register Register
  3. @ivar_grimstad JavaDay 2015 Service A Service B Service C Application

    Discovery Service Register Register Register Lookup A Call A
  4. @ivar_grimstad JavaDay 2015 Service A Service B Service C Application

    Discovery Service Register Register Register Lookup B Call B
  5. @ivar_grimstad JavaDay 2015 Service A Service B Service C Application

    Discovery Service Register Register Register Lookup B
  6. @ivar_grimstad JavaDay 2015 Service B Service A Service C Application

    Eureka Discovery Service Register Register Register @EnableEurekaClient Hardware Operating System JVM Service A Hardware Operating System JVM Service B Hardware Operating System JVM Service C
  7. @ivar_grimstad JavaDay 2015 @SpringBootApplication @EnableEurekaClient public class Application { public

    static void main(String[] args) throws Exception { SpringApplication.run(Application.class, args); } }
  8. @ivar_grimstad JavaDay 2015 Hardware Operating System JVM Service C Hardware

    Operating System JVM Service B Hardware Operating System JVM Service A Application Snoop Discovery Service Register Register Register Hardware Operating System JVM Java EE Container Service A Hardware Operating System JVM Java EE Container Service B Hardware Operating System JVM Java EE Container Service C @EnableSnoopClient
  9. @ivar_grimstad JavaDay 2015 Hardware Operating System JVM Java EE Container

    Service A Hardware Operating System JVM Java EE Container Service C Hardware Operating System JVM Java EE Container Service B Application Snoop Discovery Service Register Register Register @EnableSnoopClient Hardware Operating System Service C Hardware Operating System JVM Service B Future<Snoop>
  10. @ivar_grimstad JavaDay 2015 snoop.yml snoop: host: http://localhost port: 8080 serviceRoot:

    snoop-hello-service/api snoopService: 192.168.59.103:8081/snoop-service/
  11. @ivar_grimstad JavaDay 2015 Service A Service B Service C Application

    Snoop Discovery Service Call Call Call Lookup http:// Register ws:// Register ws:// Register ws://
  12. @ivar_grimstad JavaDay 2015 Service A1 Service A2 Service C Application

    Snoop Discovery Service Register Register Lookup Call Call Load Balancer
  13. @ivar_grimstad JavaDay 2015 Hello World Bzzz Hello World Snoop Discovery

    Service Register Register Register Payara 4.1 Docker + GlassFish 4.1 Docker + WildFly 9 Docker + WildFly 8 WildFly Swarm Lookup Call Call Call
  14. @ivar_grimstad JavaDay 2015 Hello World Bzzz Hello World Snoop Discovery

    Service Register Register Register Payara 4.1 Docker + GlassFish 4.1 Docker + WildFly 9 Docker + WildFly 8 WildFly Swarm Lookup Call Call Call
  15. @ivar_grimstad JavaDay 2015 1. Add Maven Dependency <dependency> <groupId>eu.agilejava</groupId> <artifactId>snoop</artifactId>

    <version>${snoop.version}</version> </dependency> <dependency> <groupId>eu.agilejava</groupId> <artifactId>snoop</artifactId> <version>1.3.0</version> </dependency>
  16. @ivar_grimstad JavaDay 2015 3. Configure the Service snoop: host: http://localhost

    port: 8080 serviceRoot: snoop-hello-service/api snoopService: 192.168.59.103:8081/snoop-service/