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.
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. 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. 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. 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
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. 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
30. 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
32. 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 ď
33. 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/
35. 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.
36. 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
40. 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
41. 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
50. 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/
51. 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)
55. 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
56. 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
57. 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
58. 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
⢠âŚ