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.

WildFly & WildFly Swarm

1,622 views

Published on

It was year 1999 when EJBoss made it’s debut as an alternative opensource J2EE implementation. 15+ years is more than a lifetime in technology terms and yet the JBoss Application Server project, renamed in 2013 into WildFly has managed to thrive and stay relevant by evolving into the Swiss Army Knife of Application Servers.dandreadis

In this talk we are going to look at the latest developments in WildFly and get an introduction to it’s sister project called WildFly Swarm. WildFly provides a robust, modular, lightweight, fully manageable and fast runtime, implementing the complete set of Java EE7 APIs. WildFly Swarm on the other hand gives you the ability to pick and choose only the server parts you need and bundle them with your application to create fat jars easy to deploy as microservices.

Thus with WildFly & WildFly Swarm you get the richness and maturity of Java EE combined with extreme flexibility about your deployment options in traditional setups or dynamic cloud environments.

Who’s said Java EE needs to be boring?

Published in: Software
  • Be the first to comment

WildFly & WildFly Swarm

  1. 1. @dandreadis Right size you services 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 “WildFly: the Swiss Army Knife of Runtimes”
  4. 4. @dandreadis Agenda ● WildFly Architecture ● Thinking Microservices ● WildFly Swarm
  5. 5. @dandreadis WildFly* pre-History *the server once called JBoss Application Server
  6. 6. @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 – Modular Service Container
  7. 7. @dandreadis Modular Service Container ● Small, lightweight and efficient (˜230 kb jar) ● Highly concurrent & scalable state machine ● Various start-up modes – Active, Passive, Lazy, Never Concurrent Service ContainerConcurrent Service Container Service ControllerService Controller Service RegistryService Registry Service BuilderService Builder ServiceService DepsDeps ValueValue ListenersListeners InjectorsInjectors
  8. 8. @dandreadis JBoss Modules ● WF_ROOT/jboss-modules.jar (365 kb) – Highly Concurrent Classloading – Fast O(1) dependency resolution – See only the modules you import – No need to break open the jars java -jar jboss-modules.jar -mp <module-path> <module-spec>
  9. 9. module.xml
  10. 10. @dandreadis WildFly Architecture
  11. 11. Java EE7 Full & Web distribution (134 Mb) standalone/ configuration/ configuration.xml
  12. 12. Servlet-Only distribution (28 Mb) standalone/ configuration/ configuration.xml
  13. 13. @dandreadis Out-of-the-box configurations ● standalone.xml – Web Profile++ (default) – standalone-ha – with clustering ● standalone-full.xml – plus JMS/ActiveMQ, IIOP, JSR77 – standalone-full-ha – with clustering ● domain.xml – full-ha in domain management mode – Plus load-balancer Profile
  14. 14. @dandreadis Domain Mode
  15. 15. @dandreadis Load Balancer Setup ● Fully managed end-to-end Java-based solution ● WF/Undertow can serve as – Static file server – Reverse Proxy
  16. 16. @dandreadis Next Gen Web Server – Undertow ● JBossWeb replacement (fork of Tomcat) ● Scalable Async Core w. Blocking/Non-Blocking APIs ● Handler/Composition based Architecture ● Lightweight & fully embeddable ● Servlet 3.1 ● Latest Protocol Support – HTTP/1.x / HTTPS / AJP – HTTP/2 (Plain & TLS-ALPN) – Web Sockets (JSR-356) – Server Sent Events
  17. 17. @dandreadis Undertow Performance *source: techempower.com
  18. 18. @dandreadis Port Reduction using HTTP Upgrade Only 2 Ports Open by Default ● 8080 – HTTP for Applications – Upgradable to JNDI, EJB, JMS ● 9990 – HTTP for Management (Console/JSON) – Upgradable to Native Management API (CLI/JMX)
  19. 19. @dandreadis Unified Configuration
  20. 20. @dandreadis Let’s talk Microservices
  21. 21. @dandreadis What are Microservices? This slide intentionally left blank Martin Fowler definition omitted
  22. 22. @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 ● Using fully automated deployment machinery ● Did I say small?
  23. 23. @dandreadis What Enabled Microservices? ● Elastic infrastructure, a.k.a the Cloud ● Linux Containers (Docker, Rocket, etc.) ● Orchestration Technologies (Kubernetes, Mesos, etc) ● Continuous Integration / Deployment ● The DevOps movement Caused by the need for Internet Scale
  24. 24. @dandreadis Simpler services but more complex environments *source: wikibon.com/evolving-container-arhitectures
  25. 25. @dandreadis A Word of Caution ● Every remote call will likely be x100 slower than an in-VM call ● You need to actively code for failure when crossing VMs ● Sharing state needs to be well thought of (or avoided)
  26. 26. @dandreadis A different view of Microservices
  27. 27. @dandreadis Welcome to WildFly Swarm
  28. 28. @dandreadis What is WildFly Swarm? ● WildFly Broken Apart – Decompose and reconstruct WildFly around your application – With additional functionality outside Java EE like NetflixOSS libraries, etc. – Just enough app-server for your Microservice packaged into an UberJar ● Part of the JBoss / Red Hat ecosystem
  29. 29. @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 Is portability and supportability a thing of the past?
  30. 30. @dandreadis Rightsize your Runtime around your App
  31. 31. @dandreadis Pick up the EE pieces you really need
  32. 32. @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...
  33. 33. @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.
  34. 34. @dandreadis Fractions ● WildFly Swarm compositional units ● Focus on serving specific usecases ● Define dependencies to other Fractions ● Tie together – Metadata – WildFly subsystems – MSC Services – Modules – Deployments
  35. 35. @dandreadis Fractions layer on WildFly-Core and ● 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)
  36. 36. @dandreadis Fractions (cont.) ● Expressed as Maven (GAV) coordinates: – org.wildfly.swarm:<fraction>:<version>, e.g – org.wildfly.swarm:undertow:2016.10.0 ● 83 fractions currently available – 48 stable – 35 experimental ● About 50% wrap WildFly components ● More in the pipeline
  37. 37. @dandreadis Where do I start? http://wildfly-swarm.io/generator/
  38. 38. @dandreadis
  39. 39. @dandreadis demo.zip (1kb) ├── pom.xml └── src └── main └── java └── com └── example └── demo └── rest └── HelloWorldEndpoint.java
  40. 40. @dandreadis HelloWorldEndpoint.java
  41. 41. @dandreadis How is WildFly Swarm enabled?
  42. 42. @dandreadis Building / Running ● Build: – mvn package ● Run: – mvn wildfly-swarm:run – java -jar demo-swarm.jar – IDE > Run … MyMain – IDE > Run o.w.s.Swarm
  43. 43. @dandreadis
  44. 44. @dandreadis
  45. 45. @dandreadis demo-swarm.jar (9.3Mb) ... _bootstrap/demo.war m2repo/<fractions & modules jars> modules/<bootstrap-modules.xml <bootstrap-classes> ...
  46. 46. @dandreadis Auto-detecting Fractions ● Absence of dependencies triggers fractionDetectMode ● In this example JAXRS is detected, leaving out Bean Validation, CDI & Transactions ● 4.3Mb jar ● 1330ms boot time
  47. 47. @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
  48. 48. @dandreadis Taking control of main()
  49. 49. @dandreadis Setup JDBC driver and Datasource
  50. 50. @dandreadis Find out more… wildfly-swarm.gitbooks.io/wildfly-swarm-users-guide/
  51. 51. @dandreadis Who’s said Java EE needs to be boring?
  52. 52. @dandreadis Resources ● www.wildfly.org ● github.com/wildfly ● @wildflyAS ● wildfly.org/joinus ● wildfly-swarm.io ● github.com/wildfly-swarm ● @wildflyswarm ● irc: #wildfly-swarm microprofile.io

×