with wildfly swarm and microprofile developing …...developing microservices with wildfly swarm and...

31
Developing Microservices with WildFly Swarm and MicroProfile Ken Finnigan Principal Software Engineer John Clingan Senior Principal Product Manager

Upload: others

Post on 28-May-2020

16 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: with WildFly Swarm and MicroProfile Developing …...Developing Microservices with WildFly Swarm and MicroProfile Ken Finnigan Principal Software Engineer John Clingan Senior Principal

Developing Microservices with WildFly Swarm and MicroProfile

Ken FinniganPrincipal Software Engineer

John ClinganSenior Principal Product Manager

Page 2: with WildFly Swarm and MicroProfile Developing …...Developing Microservices with WildFly Swarm and MicroProfile Ken Finnigan Principal Software Engineer John Clingan Senior Principal

Eclipse MicroProfile

Page 3: with WildFly Swarm and MicroProfile Developing …...Developing Microservices with WildFly Swarm and MicroProfile Ken Finnigan Principal Software Engineer John Clingan Senior Principal

Enterprise Java Standards History

Page 4: with WildFly Swarm and MicroProfile Developing …...Developing Microservices with WildFly Swarm and MicroProfile Ken Finnigan Principal Software Engineer John Clingan Senior Principal

Eclipse MicroProfile Background● Many innovative “microservices” efforts in existing Java EE projects

■ WildFly Swarm■ WebSphere Liberty■ Payara■ TomEE

○ Projects already leveraging both Java EE and non-Java EE technologies○ Creating new features/capabilities to address microservices architectures

● Wanted to avoid splitting into separate communities

● So we are collaborate in one community!

Page 5: with WildFly Swarm and MicroProfile Developing …...Developing Microservices with WildFly Swarm and MicroProfile Ken Finnigan Principal Software Engineer John Clingan Senior Principal

An Eclipse FoundationProject

● Meritocracy; vendor neutrality● MicroProfile leadership can change over

time● Legal and technical infrastructure● Trademark Ownership● Accepts Apache License

Page 6: with WildFly Swarm and MicroProfile Developing …...Developing Microservices with WildFly Swarm and MicroProfile Ken Finnigan Principal Software Engineer John Clingan Senior Principal

The Path to Microservices with MicroProfile

1. Leverage relevant Java EETechnologies

2. Organic Innovation

3. Collaborate in Open Source

Page 7: with WildFly Swarm and MicroProfile Developing …...Developing Microservices with WildFly Swarm and MicroProfile Ken Finnigan Principal Software Engineer John Clingan Senior Principal

Quickly Put Features in Developers Hands

2016 2017 2018 2019

8 9

1.0

1.1

1.2

2.0

2.1

2020

2.2

* 2-4 releases per year

Page 8: with WildFly Swarm and MicroProfile Developing …...Developing Microservices with WildFly Swarm and MicroProfile Ken Finnigan Principal Software Engineer John Clingan Senior Principal

Practical Usage of MicroProfile - Example

3rd Party Frameworks

Page 9: with WildFly Swarm and MicroProfile Developing …...Developing Microservices with WildFly Swarm and MicroProfile Ken Finnigan Principal Software Engineer John Clingan Senior Principal

Join Us Later Today

Optimizing Java EE for a microservices architecture

4:30 PM - 5:15 PM

Room 102B

Page 10: with WildFly Swarm and MicroProfile Developing …...Developing Microservices with WildFly Swarm and MicroProfile Ken Finnigan Principal Software Engineer John Clingan Senior Principal

WildFly Swarm

Page 11: with WildFly Swarm and MicroProfile Developing …...Developing Microservices with WildFly Swarm and MicroProfile Ken Finnigan Principal Software Engineer John Clingan Senior Principal

What is it?

● Begins with WildFly / Java EE

● Extends Java EE with cloud native capabilities

● Package deployment

○ Uber Jar - including deployment

○ Hollow Uber Jar - without deployment

Page 12: with WildFly Swarm and MicroProfile Developing …...Developing Microservices with WildFly Swarm and MicroProfile Ken Finnigan Principal Software Engineer John Clingan Senior Principal

Just enough App Server (JeAS)

● Bundles your deployment (JAR/WAR)

● Fractions define available functionality for deployment

● Internal Maven repository with dependencies

● Bootstrap Code

Page 13: with WildFly Swarm and MicroProfile Developing …...Developing Microservices with WildFly Swarm and MicroProfile Ken Finnigan Principal Software Engineer John Clingan Senior Principal

Fractions...

● Enable WildFly subsystems (e.g. Infinispan)

● Integrate additional frameworks/services (e.g. Topology)

● Provide deployments (e.g. Swagger, Jolokia)

● Add API dependencies (e.g. JAX-RS)

● Alter deployments (e.g. Keycloak)

Page 14: with WildFly Swarm and MicroProfile Developing …...Developing Microservices with WildFly Swarm and MicroProfile Ken Finnigan Principal Software Engineer John Clingan Senior Principal

Fractions...

● Expressed as Maven (GAV) coordinates:○ org.wildfly.swarm:<fraction>:<version>, e.g○ org.wildfly.swarm:undertow:2017.5.0

● 184 fractions currently available○ 158 stable○ 26 experimental

● About 80% wrap WildFly related components (Java EE, WF Camel, internal WF)

● More in the pipeline

Page 15: with WildFly Swarm and MicroProfile Developing …...Developing Microservices with WildFly Swarm and MicroProfile Ken Finnigan Principal Software Engineer John Clingan Senior Principal

Enabling WildFly Swarm

<plugin> <groupId>org.wildfly.swarm</groupId> <artifactId>wildfly-swarm-plugin</artifactId> <version>${version.wildfly.swarm}</version> <executions> <execution> <id>package</id> <goals> <goal>package</goal> </goals> </execution> </executions> </plugin>

Page 16: with WildFly Swarm and MicroProfile Developing …...Developing Microservices with WildFly Swarm and MicroProfile Ken Finnigan Principal Software Engineer John Clingan Senior Principal

AUTO DETECTION DEMO

Page 17: with WildFly Swarm and MicroProfile Developing …...Developing Microservices with WildFly Swarm and MicroProfile Ken Finnigan Principal Software Engineer John Clingan Senior Principal

Enabling specific WildFly Swarm Fractions

<dependency> <groupId>org.wildfly.swarm</groupId> <artifactId>bom</artifactId> <version>${version.wildfly.swarm}</version> <type>pom</type> <scope>import</import> </dependency>

Page 18: with WildFly Swarm and MicroProfile Developing …...Developing Microservices with WildFly Swarm and MicroProfile Ken Finnigan Principal Software Engineer John Clingan Senior Principal

Enabling specific WildFly Swarm Fractions

<dependency> <groupId>org.wildfly.swarm</groupId> <artifactId>jaxrs</artifactId> </dependency>

Page 19: with WildFly Swarm and MicroProfile Developing …...Developing Microservices with WildFly Swarm and MicroProfile Ken Finnigan Principal Software Engineer John Clingan Senior Principal

Build / Run

Build

mvn package

Run

mvn wildly-swarm:run

OR

java -jar <my-app>-swarm.jar

OR

IDE > Run … org.wildfly.swarm.Swarm()

Page 20: with WildFly Swarm and MicroProfile Developing …...Developing Microservices with WildFly Swarm and MicroProfile Ken Finnigan Principal Software Engineer John Clingan Senior Principal

Flexible Configuration● Maven Plugin

… <swarm.http.port>8081</swarm.http.port> …

● Java propertiesjava -Dswarm.http.port=8081 myapp.jar

● JBoss EAP configurationjava myapp.jar -c standalone.xml

● Environment-specific configurationjava myapp.jar -s project-production.yml

Page 21: with WildFly Swarm and MicroProfile Developing …...Developing Microservices with WildFly Swarm and MicroProfile Ken Finnigan Principal Software Engineer John Clingan Senior Principal

MICROPROFILE DEMO

Page 22: with WildFly Swarm and MicroProfile Developing …...Developing Microservices with WildFly Swarm and MicroProfile Ken Finnigan Principal Software Engineer John Clingan Senior Principal

Proposed Eclipse MicroProfile Features

● WildFly Swarm status:

○ Configuration - Implementation being worked on at present

○ Health Check - Align with monitor fraction when released

○ Security - May just require validation with keycloak fraction

Page 23: with WildFly Swarm and MicroProfile Developing …...Developing Microservices with WildFly Swarm and MicroProfile Ken Finnigan Principal Software Engineer John Clingan Senior Principal

Health Checks

● monitor fraction was basis for MicroProfile Health Check specification

● Ability to add /health endpoints to microservice

● Integration with OpenShift Readiness/Liveness Checks

○ via fabric8-maven-plugin

Page 24: with WildFly Swarm and MicroProfile Developing …...Developing Microservices with WildFly Swarm and MicroProfile Ken Finnigan Principal Software Engineer John Clingan Senior Principal

Health Checks

<dependency> <groupId>org.wildfly.swarm</groupId> <artifactId>monitor</artifactId> </dependency>

<enricher> <includes> <include>wildfly-swarm-health-check</include> </includes> </enricher>

Page 25: with WildFly Swarm and MicroProfile Developing …...Developing Microservices with WildFly Swarm and MicroProfile Ken Finnigan Principal Software Engineer John Clingan Senior Principal

HEALTHCHECK DEMO

Page 26: with WildFly Swarm and MicroProfile Developing …...Developing Microservices with WildFly Swarm and MicroProfile Ken Finnigan Principal Software Engineer John Clingan Senior Principal

WildFly Swarm Community

● IRC - #wildfly-swarm on Freenode

● Google Group - https://groups.google.com/forum/#!forum/wildfly-swarm

● JIRA - https://issues.jboss.org/browse/SWARM

● Twitter - @wildflyswarm

Page 27: with WildFly Swarm and MicroProfile Developing …...Developing Microservices with WildFly Swarm and MicroProfile Ken Finnigan Principal Software Engineer John Clingan Senior Principal

Java Microservices Book● Recently released into MEAP

● Uses WildFly Swarm

● 39% discount on all Manning books with code: ctwrhsummit17

https://www.manning.com/books/java-microservices-in-action

Page 28: with WildFly Swarm and MicroProfile Developing …...Developing Microservices with WildFly Swarm and MicroProfile Ken Finnigan Principal Software Engineer John Clingan Senior Principal

QUESTIONS ?

Page 29: with WildFly Swarm and MicroProfile Developing …...Developing Microservices with WildFly Swarm and MicroProfile Ken Finnigan Principal Software Engineer John Clingan Senior Principal

Demo CodeAvailable from:

https://github.com/kenfinnigan/wfswarm-rhsummit2017

Page 30: with WildFly Swarm and MicroProfile Developing …...Developing Microservices with WildFly Swarm and MicroProfile Ken Finnigan Principal Software Engineer John Clingan Senior Principal

THANK YOUplus.google.com/+RedHat

linkedin.com/company/red-hat

youtube.com/user/RedHatVideos

facebook.com/redhatinc

twitter.com/RedHatNews

Page 31: with WildFly Swarm and MicroProfile Developing …...Developing Microservices with WildFly Swarm and MicroProfile Ken Finnigan Principal Software Engineer John Clingan Senior Principal