Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
@dandreadis
Turn you Java EE Monoliths
into Microservices with
Dimitris Andreadis
Sr. Engineering Manager
Red Hat JBoss EA...
@dandreadis
Once upon a time*
*http://dandreadis.blogspot.ch/2014/10/10-years-on-red-pill.html
@dandreadis
Agenda
● Thinking Microservices
● WildFly Architecture
● WildFly Swarm Concepts
● Getting Started with Swarm
●...
@dandreadis
Let’s talk Microservices
@dandreadis
What are Microservices?
@dandreadis
What are Microservices?
● A bit like SOA (but smaller?)
● Written in any cool programming language
● By (small...
@dandreadis
Why do Microservices?
1) Because everyone else does it
2) Because you have to go internet scale
3) Because you...
@dandreadis
You Must Be This Tall*
● Self-Service, On Demand, Elastic Infrastructure as code
● Deployment Independence
● F...
@dandreadis
Simpler services but more complex environments
*source: wikibon.com/evolving-container-arhitectures
@dandreadis
“Rolling out Microservices
requires some sort of a
Distributed Application Server” *
*Dimitris Andreadis, Voxx...
@dandreadis
@dandreadis
“Right Size” the Runtime
@dandreadis
JBoss “Innovation” ca. 2001
● Collapse the EJB and Servlet
layer in a single VM to avoid
x100 slower remote ca...
@dandreadis
A tiny bit of WildFly Architecture
@dandreadis
WildFly* pre-History
*the server once called JBoss Application Server
@dandreadis
Kernel Taxonomy
● JBoss AS 2.x, 3.x, 4.x
– JMX MicroKernel
● JBoss AS 5.x, 6.x
– JBoss MicroContainer
● AS7.x,...
Java EE7 Full & Web
distribution (134 Mb)
standalone/
configuration/
configuration.xml
Servlet-Only
distribution (28 Mb)
standalone/
configuration/
configuration.xml
@dandreadis
WildFly
"the Swiss Army
Knife of Runtimes”
@dandreadis
Welcome to WildFly Swarm
@dandreadis
What is WildFly Swarm?
● WildFly Broken Apart
– Decompose and reconstruct WildFly
around your application
– Ju...
@dandreadis
Rightsize your Runtime around your App
@dandreadis
Plus a lot more components!
● Keycloak (SSO)
● Hystrix (Circuit Breaker)
● Ribbon (client side LB)
● Vert.x (r...
@dandreadis
Why WildFly Swarm?
● Leverage your Java EE expertise
● Build on mature technologies
and a scalable runtime
● B...
@dandreadis
@dandreadis
Self-contained (Uber) Jar
● bundles your application,
● the Fractions to support it,
● an internal Maven repos...
@dandreadis
Concept of a Fraction
● WildFly Swarm compositional units
● Providing specific runtime capabilities
● And diff...
@dandreadis
Fractions
● Enable WildFly subsystems (e.g. Infinispan)
● Integrate additional frameworks/services (e.g. Topol...
@dandreadis
Fractions (cont.)
● Expressed as Maven (GAV) coordinates:
– org.wildfly.swarm:<fraction>:<version>, e.g
– org....
@dandreadis
Where do I start?
http://wildfly-swarm.io/generator/
@dandreadis
@dandreadis
demo.zip (1kb)
├── pom.xml
└── src
└── main
└── java
└── com
└── example
└── demo
└── rest
└── HelloWorldEndpo...
@dandreadis
HelloWorldEndpoint.java
@dandreadis
How is WildFly Swarm enabled?
@dandreadis
● mvn package
demo-swarm.jar
...
_bootstrap/demo.war
m2repo/<fractions & modules jars>
modules/<bootstrap-modu...
@dandreadis
Run
● java -jar demo-swarm.jar
● mvn wildfly-swarm:run
● IDE > Run o.w.s.Swarm
● IDE > Run … MyMain
@dandreadis
java -jar target/demo-swarm.jar
@dandreadis
@dandreadis
Auto-detecting Fractions
● Absence of dependencies
triggers fractionDetectMode
@dandreadis
JAXRS fraction selected
Bean Validation, CDI, CDI-Config, Transactions, JAX-RS w.
JAXB, JAX-RS w. JSON-P, Micr...
@dandreadis
How Fractions are configured?
● Default configuration with sensible defaults
● System properties to override c...
@dandreadis
Taking control of main()
@dandreadis
Setup JDBC driver and Datasource
@dandreadis
Environment specific configuration
./src/main/resources/project-stages.yml
logger:
level: DEBUG
database:
jdbc...
@dandreadis
Resources
● wildfly-swarm.io
● github.com/wildfly-swarm
● @wildflyswarm
● irc: #wildfly-swarm
● www.wildfly.or...
@dandreadis
Thanks!
Turn you Java EE Monoliths into Microservices with WildFly Swarm
Turn you Java EE Monoliths into Microservices with WildFly Swarm
Upcoming SlideShare
Loading in …5
×

Turn you Java EE Monoliths into Microservices with WildFly Swarm

1,072 views

Published on

Presentation given at Voxxed Days Athens, May 19th, Athens.

Published in: Technology
  • Be the first to comment

Turn you Java EE Monoliths into Microservices with WildFly Swarm

  1. 1. @dandreadis Turn you Java EE Monoliths into Microservices with Dimitris Andreadis Sr. Engineering Manager Red Hat JBoss EAP / WildFly
  2. 2. @dandreadis Once upon a time* *http://dandreadis.blogspot.ch/2014/10/10-years-on-red-pill.html
  3. 3. @dandreadis Agenda ● Thinking Microservices ● WildFly Architecture ● WildFly Swarm Concepts ● Getting Started with Swarm ● Advanced Configuration Options
  4. 4. @dandreadis Let’s talk Microservices
  5. 5. @dandreadis What are Microservices?
  6. 6. @dandreadis What are Microservices? ● A bit like SOA (but smaller?) ● Written in any cool programming language ● By (smaller?) two-pizza teams ● Who break monoliths into (small?) services ● That encapsulate fully some (small?) vertical application aspect ● And run them independently in their own (smaller?) containers Did I say small?
  7. 7. @dandreadis Why do Microservices? 1) Because everyone else does it 2) Because you have to go internet scale 3) Because you want to deliver fast
  8. 8. @dandreadis You Must Be This Tall* ● Self-Service, On Demand, Elastic Infrastructure as code ● Deployment Independence ● Full stack Ownership ● Dev vs Ops ● Automation & Immutability ● CI/CD pipeline ● Agile Delivery *thanks Burr Shutter for letting me steal your slide :)
  9. 9. @dandreadis Simpler services but more complex environments *source: wikibon.com/evolving-container-arhitectures
  10. 10. @dandreadis “Rolling out Microservices requires some sort of a Distributed Application Server” * *Dimitris Andreadis, Voxxed Athens, May 2017
  11. 11. @dandreadis
  12. 12. @dandreadis “Right Size” the Runtime
  13. 13. @dandreadis JBoss “Innovation” ca. 2001 ● Collapse the EJB and Servlet layer in a single VM to avoid x100 slower remote calls! ● No need to actively code for remote call failure either :)
  14. 14. @dandreadis A tiny bit of WildFly Architecture
  15. 15. @dandreadis WildFly* pre-History *the server once called JBoss Application Server
  16. 16. @dandreadis Kernel Taxonomy ● JBoss AS 2.x, 3.x, 4.x – JMX MicroKernel ● JBoss AS 5.x, 6.x – JBoss MicroContainer ● AS7.x, WildFly 8.x, 9.x, 10.x – JBoss Modules & Modular Service Container
  17. 17. Java EE7 Full & Web distribution (134 Mb) standalone/ configuration/ configuration.xml
  18. 18. Servlet-Only distribution (28 Mb) standalone/ configuration/ configuration.xml
  19. 19. @dandreadis WildFly "the Swiss Army Knife of Runtimes”
  20. 20. @dandreadis Welcome to WildFly Swarm
  21. 21. @dandreadis What is WildFly Swarm? ● WildFly Broken Apart – Decompose and reconstruct WildFly around your application – Just enough app-server for your Microservice packaged into an UberJar – With additional functionality outside Java EE like NetflixOSS libraries, etc. ● Part of the JBoss / Red Hat ecosystem
  22. 22. @dandreadis Rightsize your Runtime around your App
  23. 23. @dandreadis Plus a lot more components! ● Keycloak (SSO) ● Hystrix (Circuit Breaker) ● Ribbon (client side LB) ● Vert.x (reactive) ● Undertow (web server) ● Camel (integration) ● Hashicorp Consul (discovery) ● Swagger (service contracts) ● LogStash (log aggregation) ● and more...
  24. 24. @dandreadis Why WildFly Swarm? ● Leverage your Java EE expertise ● Build on mature technologies and a scalable runtime ● Be part of the future of Java EE and help shape it for the Cloud
  25. 25. @dandreadis
  26. 26. @dandreadis Self-contained (Uber) Jar ● bundles your application, ● the Fractions to support it, ● an internal Maven repository with the dependencies, ● and Bootstrap code. ● There is also the notion of a Hollow launch-pad type of jar.
  27. 27. @dandreadis Concept of a Fraction ● WildFly Swarm compositional units ● Providing specific runtime capabilities ● And different means to configure them – with reasonable default
  28. 28. @dandreadis 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. SSO)
  29. 29. @dandreadis Fractions (cont.) ● Expressed as Maven (GAV) coordinates: – org.wildfly.swarm:<fraction>:<version>, e.g – org.wildfly.swarm:undertow:2017.05.0 ● 169 fractions currently available – 148 stable – 15 unstable – 6 experimental ● More in the pipeline
  30. 30. @dandreadis Where do I start? http://wildfly-swarm.io/generator/
  31. 31. @dandreadis
  32. 32. @dandreadis demo.zip (1kb) ├── pom.xml └── src └── main └── java └── com └── example └── demo └── rest └── HelloWorldEndpoint.java
  33. 33. @dandreadis HelloWorldEndpoint.java
  34. 34. @dandreadis How is WildFly Swarm enabled?
  35. 35. @dandreadis ● mvn package demo-swarm.jar ... _bootstrap/demo.war m2repo/<fractions & modules jars> modules/<bootstrap-modules.xml <bootstrap-classes> ... Build
  36. 36. @dandreadis Run ● java -jar demo-swarm.jar ● mvn wildfly-swarm:run ● IDE > Run o.w.s.Swarm ● IDE > Run … MyMain
  37. 37. @dandreadis java -jar target/demo-swarm.jar
  38. 38. @dandreadis
  39. 39. @dandreadis Auto-detecting Fractions ● Absence of dependencies triggers fractionDetectMode
  40. 40. @dandreadis JAXRS fraction selected Bean Validation, CDI, CDI-Config, Transactions, JAX-RS w. JAXB, JAX-RS w. JSON-P, Microprofile fractions removed
  41. 41. @dandreadis How Fractions are configured? ● Default configuration with sensible defaults ● System properties to override common settings ● standalone.xml or a fragment of it can override settings - or - ● Take control of main() and use the fluent Java API – Covers all WildFly subsystems – Generated from the WF configuration schema
  42. 42. @dandreadis Taking control of main()
  43. 43. @dandreadis Setup JDBC driver and Datasource
  44. 44. @dandreadis Environment specific configuration ./src/main/resources/project-stages.yml logger: level: DEBUG database: jdbc: url: foo --- project: stage: development logger: level: DEBUG database: jdbc: url: bar --- project: stage: production logger: level: INFO database: jdbc: url: somethingElse
  45. 45. @dandreadis Resources ● wildfly-swarm.io ● github.com/wildfly-swarm ● @wildflyswarm ● irc: #wildfly-swarm ● www.wildfly.org ● github.com/wildfly ● @wildflyAS ● wildfly.org/joinus wildfly-swarm.gitbooks.io/wildfly-swarm-users-guide/
  46. 46. @dandreadis Thanks!

×