javantura v4 - kumuluzee – microservices with java - matjaž b. jurič & tilen faganel

Post on 12-Apr-2017

284 Views

Category:

Technology

3 Downloads

Preview:

Click to see full reader

TRANSCRIPT

KUMULUZEE –

MICROSERVICES WITH JAVA

Tilen Faganel

Sunesis d.o.o.

Mail: tilen.faganel@sunesis.si

Github: @tfaga

Web: https://kumuluz.com

Matjaž B. Jurič

UL FRI

Mail: matjaz.juric@kumuluz.com

Web: https://kumuluz.com

Microservice architecture by example

Lets build an online store!

UI UI

Catalogue Catalogue

Cart & payment Cart & payment

Delivery Delivery

Application server

WAR/EAR

DB

Queue

Monolith applications

Well-known

Easier to manage and deploy

Intimidating to developers

Scaling can be difficult

Continuous deployment can be difficult

UI UI

Catalogue Catalogue

Cart & payment Cart & payment

Delivery Delivery

NoSQL DB

DB

Queue

UI UI

Catalogue Catalogue

Cart & payment Cart & payment

Delivery Delivery

NoSQL DB

DB

Queue

Catalogue Catalogue Catalogue Catalogue

Cart & payment Cart & payment

Perfect for building new, modern, cloud-native Java applications

Use standard EE APIs

Completely modular

Easy migration of existing

applications

Automates configuration

Pack into independent JAR

Servlet + JAX-RS

+ JPA, CDI,

Bean Validation,

JSON-P

JAR size 1,5 MB 5 MB 15 MB

<dependency>

<groupId>com.kumuluz.ee</groupId>

<artifactId>kumuluzee-core</artifactId>

<version>2.0.0</version>

</dependency>

<dependency>

<groupId>com.kumuluz.ee</groupId>

<artifactId>kumuluzee-servlet-jetty</artifactId>

<version>2.0.0</version>

</dependency>

<dependency>

<groupId>com.kumuluz.ee</groupId>

<artifactId>kumuluzee-jax-rs-jersey</artifactId>

<version>2.0.0</version>

</dependency>

Add the required dependencies

(only the components or implementations,

that we want)

@Path("catalog")

public class SampleREST {

@GET

@Produces({"application/xml", "application/json"})

public Response hello() {

return Response.ok(“Hello from KumuluzEE”);

}

}

Use standard Java EE APIs

@ApplicationPath("rest")

public class RestApplication extends Application {

}

build

$ mvn clean package

run directly

$ java -cp target/classes:target/dependency/* com.kumuluz.ee.EeApplication

or run the created JAR

$ java -jar target/kumuluzee-example-1.0.0-SNAPSHOT.jar

Docker

First class support for Docker containers - for every cloud

Demo

Complexity of the system increases

Management of multiple databases

Transaction boundaries are smaller

More coordination is required

Drawbacks

How about existing Java EE applications?

How can we migrate the monoliths into microservices step-by-step?

Package, configure, deploy and scale

Tilen Faganel

Sunesis d.o.o.

Mail: tilen.faganel@sunesis.si

Github: @tfaga

Web: https://kumuluz.com

Matjaž B. Jurič

UL FRI

Mail:

matjaz.juric@kumuluz.com

Web: https://kumuluz.com

top related