WildFly AppServer - State of the Union

2,893 views

Published on

WildFly AppServer - State of the Union
as presented at SoftShake Geneva, Oct 2015

http://soft-shake.ch/2015/en/

Covering the whole WildFly v8/9/10 series and the key aspects of the base AS7 architecture.

Published in: Software
0 Comments
5 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
2,893
On SlideShare
0
From Embeds
0
Number of Embeds
1,432
Actions
Shares
0
Downloads
0
Comments
0
Likes
5
Embeds 0
No embeds

No notes for slide

WildFly AppServer - State of the Union

  1. 1. WildFly App Server State of the Union Dimitris Andreadis Sr. Engineering Mgr Red Hat JBoss EAP / WildFly twitter: @dandreadis
  2. 2. How it all started? (for me*) *http://dandreadis.blogspot.ch/2014/10/10-years-on-red-pill.html
  3. 3. JBoss AS/EAP, WildFly Fan(atic) •2001, JBoss User •2003, JBoss Committer •2004, JBoss Full-time Core Developer •2006, JBoss AS Lead (v3.2.8+, v4.0.4+, v4.2.x, 5.0.x) •2009, JBoss AS Engineering Manager •2013, JBoss EAP/WildFly Sr. Engineering Manager And before JBoss? •7y experience in distributed systems (telcos, NMS/OSS) •BSc/MSc Computer Science (Athens/Dublin) about.me/dandreadis
  4. 4. Agenda • WildFly pre-History • WildFly V8 Recap • WildFly V9 Update • WildFly Swarm & V10
  5. 5. WildFly* pre-History *the server once called JBoss Application Server
  6. 6. JBoss AS Timeline 20072006200520042003 JBossVersions Time JBoss AS 4.0.0 – 4.0.5 JBoss AS 4.2.0 – 4.2.3 JBoss AS 5: 5.0.0.GA, 5.0.1.GA JBoss AS 3.2.0 – 3.2.8 JBoss AS 5.1 20092008 J2EE 1.3, JDK 1.3 JMX MicroKernel Architecture J2EE 1.4 certification JTS, JDK 1.4 JEE 5.0 compatible, not certified (95% pass) JDK5.0, EAP 4.2 basis JavaEE 5 certification, JDK5 & 6 MicroContainer Architecture 2010 2011 JBoss AS 6.0, 6.1 JBoss AS 7.0, 7.0.1, 7.0.2 JavaEE 6 Web Profile, JDK6 JavaEE 6 Web Profile, JDK6/JDK7 Modular Service Container Architecture 2012 JBoss AS 7.1, 7.1.1 JavaEE 6 Full Profile, JDK6/JDK7 Complete Clustering Support, EAP6 basis JSF-Based Console, EAP5 basis Red Hat Acquisition
  7. 7. Project vs EE spec • JBoss AS 2  J2EE 1.2 • JBoss AS 3  J2EE 1.3 • JBoss AS 4  J2EE 1.4 • JBoss AS 5  Java EE 5 • JBoss AS 6 , AS7  Java EE 6 • WildFly 8, 9, 10  Java EE 7
  8. 8. Project vs EE spec vs Product • JBoss AS 2  J2EE 1.2 • JBoss AS 3  J2EE 1.3 • JBoss AS 4  J2EE 1.4  EAP 4 • JBoss AS 5  Java EE 5  EAP 5 • JBoss AS 6 , AS7  Java EE 6  EAP 6 • WildFly 8, 9, 10  Java EE 7  EAP 7 *Red Hat JBoss Enterprise Application Platform (EAP)
  9. 9. WildFly vs JBoss EAP
  10. 10. JBoss AS Kernel Taxonomy • JBoss AS 2.x, 3.x, 4.x • JBoss JMX MicroKernel • JBoss AS 5.x, 6.x • JBoss MC - MicroContainer • JBoss AS7.x, WildFly 8.x, 9, 10 • JBoss MSC - Modular Service Container
  11. 11. AS7 Innovations - MSC Modular Services Container (MSC) • Small, lightweight, and efficient • Highly concurrent & scalable state machine • Multiple startup modes •Active, Passive, On-Demand, Lazy, Never Concurrent Service Container Service Controller Service Registry Service Builder Service Deps Value Listeners Injectors
  12. 12. Innovations – JBoss Modules Small, lightweight, and efficient •Highly concurrent class loading •Fast with O(1) dependency resolution “Pure” modular class loading •Modules only see what they import •Including JDK classes External module definitions •Don’t have to break open the JAR
  13. 13. Modular Class Loading • A graph of Class Loaders, not a tree • Modules delegate to one another as peers • A module imports modules it directly uses • Transitive dependencies are hidden, by default • Different module versions may co-exist
  14. 14. modulesorghornetqmainmodule.xml <module xmlns="urn:jboss:module:1.0" name="org.hornetq"> <resources> <resource-root path="hornetq-core-2.2.10.Final.jar"/> <resource-root path="hornetq-jms-2.2.10.Final.jar"/> </resources> <dependencies> <module name="javax.api"/> <module name="javax.jms.api"/> <module name="javax.resource.api"/> <module name="org.jboss.jts"/> <module name="org.jboss.netty"/> </dependencies> </module>
  15. 15. So What?
  16. 16. #@*%ing fast! http://community.jboss.org/wiki/AS7StartupTimeShowdown
  17. 17. Boot Time Results
  18. 18. Memory Comparison
  19. 19. @#$% fast: How is it done? • Concurrent startup/deployments • Faster resource lookup/classloading • Annotation indexing • Caching of reflection metadata • Lazy loading of (some) services • StAX based descriptor parsing • Starting from scratch 
  20. 20. Two Operational Modes Standalone •Traditional JBoss single JVM server •Management facilities IN-VM •No lifecycle management (only shutdown) Domain •Multi-JVM, multi-server model •Management coordinated by Domain Controller Process •Multiple server instances (JVMs) per Host •Full lifecycle managed by Process Controller
  21. 21. Domain Mode
  22. 22. User-focused Configuration <bean name="TransactionManager" class="com.arjuna.ats.jbossatx.jta.TransactionManagerService"> <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss:service=TransactionManager", exposedInterface=com.arjuna.ats.jbossatx.jta.TransactionManagerServiceMBean.class, registerDirectly=true)</annotation> <annotation>@org.jboss.managed.api.annotation.ManagementObject(name="TransactionManager",componentType=@org.jb oss.managed.api.annotation.ManagementComponent(type = "MCBean", subtype = "JTA"),targetInterface=com.arjuna.ats.jbossatx.jta.TransactionManagerServiceMBean.class) </annotation> <property name="transactionTimeout">300</property> <property name="objectStoreDir">${jboss.server.data.dir}/tx-object-store</property> <subsystem xmlns="urn:jboss:domain:transactions:1.0"> <recovery-environment socket-binding="txn-recovery-environment" status-socket-binding="txn-status-manager"/> <core-environment socket-binding="txn-socket-process-id"/> </subsystem>
  23. 23. Management APIs • Command Line Interface (CLI) • Remote Java API • HTTP/JSON API • GWT-based console • JMX mapping
  24. 24. 1st Class Components
  25. 25. JBoss Name Overload • JBoss Application Server (the project) • JBoss Company (jboss.com) • JBoss Community (jboss.org) • JBoss Projects (e.g. JBoss Cache) • JBoss Product Line (EAP, SOA-P, etc.) Why Rename JBoss?
  26. 26. V8 Recap*
  27. 27. WildFly 8 – Features* • 100% Java EE7 certified (Web & Full profiles) • plus CDI 1.2, WebSockets 1.1 • High Performance Web Server (Undertow) • Port reduction (8080, 9990) • Update Infrastructure • Role Based Administration (RBAC) • Audit Logging *WildFly 8.0 Final – Feb/2014
  28. 28. EE7 Highlights
  29. 29. EE7 Highlights – New Techs JSR-352 Batch Applications for the Java Platform •Runtime & Artifact API, XML-based Job specification lang. JSR-236 Concurrency Utilities for JavaEE •Executor, Scheduled Executor, Thread Factory, Context JSR-353 Java API for JSON Processing (JSON-P) •Parse, transform and query JSON data JSR-356 Web Sockets support •Annotation driven endpoints and lifecycle callbacks
  30. 30. EE7 Highlights – Spec. Updates JSR-345 EJB 3.2, plus Interceptors 1.2, Annotations 1.2 •Misc. improvements JSR-340 Servlet 3.1 •Non-blocking I/O, HTTP upgrade, etc. JSR-342 JMS 2.0 •Shared topic subs, delayed delivery, async send, etc. JSR-344 JSF 2.2 •HTML 5, FaceFlows, Stateless Views, Resource lib contracts JSR-322 JCA 1.7 •Activation name for msg endpoints (WTF?)
  31. 31. EE7 Highlights – Optional Techs Removed in WildFly 8 •EJB 2.1 Entity Beans (CMP/BMP) •JAX-RPC (API for XML-based RPC) •JAXR (API for XML Registries) •JSR-88 (Deployment API) • it has re-surfaced in JSR 373 (JSR-77 successor) JavaTM EE Management API 2.0 
  32. 32. New WebServer - Undertow • Blocking / non-blocking NIO based APIs • Composition/handler based architecture • Lightweight & fully embeddable • Supports WebSockets, including JSR-356 • Supports Servlet 3.1 • HTTP upgrade http://undertow.io/
  33. 33. Undertow – Embedded Server
  34. 34. Port Reduction • HTTP Upgrade allow us to reduce the number of ports in the default installation to just 2: • 8080 – for applications with JNDI and EJB multiplexed • 9990 – for management, for both HTTP/JON & Native APIs • The only overhead is the initial HTTP Upgrade request/response.
  35. 35. Administrative Access Control • Administrative users can be mapped to Roles • Role = set of Permissions • Permission: • Action (access, read/write config, read/write runtime) • Set of Constraints (target) • Sensitive resource type, attribute or operation • Sensitive data • Audit Resource • Application Resource
  36. 36. Roles Monitor – reads non sensitive configuration and state Operator – Monitor + start/stop server & queues Maintainer – Operator + deploy Apps & Queues Deployer – Maintainer + config Apps Administrator – Maintainer + system config - audit logging Auditor – Monitor + audit logging config SuperUser - Everything
  37. 37. Administrative Audit Logging • Logging of connection / authentication events • Logging of management operations • Log Message as JSON Records • Audit Logging Handlers • Local file • Syslog (UDP / TCP / TLS)
  38. 38. V9 Update
  39. 39. WildFly 9 – Features* • Core/Full Split and Servlet-only distribution • Front-end load balancer with mod_cluster support • Undertow HTTP/2 & SPDY support • Graceful shutdown (suspend(timeout)/resume) • Switching to the JDK ORB from JacORB • Offline CLI Mode • etc. *WildFly 9.0 Final – Jul/2015
  40. 40. WildFly-Core Base Runtime for WildFly server includes • Modular class loading • Modular Service Container • Unified management, including domain mode • Basic deployment architecture • CLI for management • Logging • JMX MSC JBoss Modules DMR Controller Threads Core Infrastructure Server Controller Service Deployers VFS Jandex Reflect Cache Repository
  41. 41. WildFly-Web • Servlet-Only distribution • Undertow and Naming added Include your own frameworks
  42. 42. WildFly distro extensions WF-Full ~380 services
  43. 43. WF-Servlet distro extensions WF-Servlet ~100 services
  44. 44. WF-Core distro extensions WF-Core ~58 services
  45. 45. WildFly Swarm* *WildFly broken apart
  46. 46. Microservices
  47. 47. Perfect Storm! Applications & Services
  48. 48. wildfly-swarm* Turn your .war into a fat jar with just enough of the WildFly Runtime to support your use case • Include the wildfly-swarm-plugin in your pom.xml • Declare any dependencies on: Undertow, JAX-RS, Naming/JNDI, Transactions, Messaging, Datasources, Logging, Weld/CDI, MSC Security *http://wildfly.org/news/2015/05/05/WildFly-Swarm-Released/
  49. 49. wildfly-swarm [ Write your own main() to override default configuration and reference it in your MANIFEST.MF ] Voila! java –jar myapp-swarm.jar (boots in < 1sec)
  50. 50. V9 Update (cont.)
  51. 51. WF/Undertow as Load Balancer • Full Java solution controlled centrally • Implements mod_cluster • HTTP, HTTP/2, AJP http://blog.eisele.net/2015/01/developer-interview-di-11-stuart-douglas-about-wildfly9-undertow.html
  52. 52. HTTP/2 (vs HTTP/v1.x) Primary goal of HTTP/2 is to reduce latency and make efficient use of the TCP connection.
  53. 53. Undertow HTTP/2 support HTTP/2 characteristics • Binary Framing • Request/Response multiplexing • Header compression (HPACK) • Stream prioritization • Server Push • HTTP Upgrade or NPN/ALPN* Undertow implements HTTP/2 (& SPDY) *requires special JDK8 setup
  54. 54. JSR-369 Servlet 4.0 Brings HTTP/2 Support to Java EE8 • Server Push • Stream Prioritization • Request/Response Multiplexing JEP 110: HTTP/2 Client • Basic Protocol Support in Java SE 9 • new HTTP client API that implements HTTP/2 and WebSocket, and can replace the legacy HttpURLConnection API http://stackoverflow.com/questions/10480122/difference-between-http-pipeling-and-http-multiplexing-with-spdy
  55. 55. Server Push with Undertow http://undertow.io/blog/2015/03/25/Server-Push.html or use the Undertow Learning Push Handler • learns which requested resources are requested per page and pushes them proactively
  56. 56. Graceful Shutdown • Essentially suspend(timeout) / resume() • Allow active sessions/requests/in-flight-tx to complete • After suspend the server may be restarted • Action per subsystem may vary • Reject new requests (HTTP Error 503 - Service unavailable) • Clustering could fail over sessions • mod_cluster could notify load balancer • …
  57. 57. V10 Update
  58. 58. Alpha1 – May/15th Alpha2 – Jun/2nd Alpha3 – Jun/16th Alpha4 – Jun/30th …bi-weekly CR1 – Sep/2015 CR2 – Sep/2015 CR3 – Oct/2015 CR4 – Today?  We are Here Final – Nov/2015 WF 10 – Roadmap
  59. 59. WF10 Features • Requires Java 8+ • HornetQ  ActiveMQ Artemis • Hibernate 5 • JMS Graceful Shutdown • HA & MDB Singleton Deployments • Improved UI for large domains • Hierarchical Profiles • Offline CLI for Domain Mode • Server-side JavaScript support (Undertow.js) with hot reloading
  60. 60. http://wildfly.org/downloads/
  61. 61. http://wildfly.org/joinus/

×